Skip to content

Commit 459fa8c

Browse files
committedJul 2, 2016
[style dock] fix crash with undo widget
1 parent 600ff4f commit 459fa8c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎src/app/qgslayerstylingwidget.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ void QgsLayerStylingWidget::setLayer( QgsMapLayer *layer )
139139
}
140140

141141
mCurrentLayer = layer;
142+
143+
mUndoWidget->setUndoStack( layer->undoStackStyles() );
144+
142145
connect( mCurrentLayer, SIGNAL( styleChanged() ), this, SLOT( updateCurrentWidgetLayer() ) );
143146

144147
int lastPage = mOptionsListWidget->currentIndex().row();
@@ -171,7 +174,6 @@ void QgsLayerStylingWidget::setLayer( QgsMapLayer *layer )
171174
{
172175
if ( factory->supportsLayer( layer ) )
173176
{
174-
QgsDebugMsg( "MAKING PANEL" );
175177
QListWidgetItem* item = new QListWidgetItem( factory->icon(), QString() );
176178
mOptionsListWidget->addItem( item );
177179
int row = mOptionsListWidget->row( item );
@@ -285,8 +287,6 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
285287

286288
mBlockAutoApply = true;
287289

288-
mUndoWidget->setUndoStack( mCurrentLayer->undoStackStyles() );
289-
290290
whileBlocking( mLayerCombo )->setLayer( mCurrentLayer );
291291

292292
int row = mOptionsListWidget->currentIndex().row();
@@ -296,7 +296,6 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
296296
QgsPanelWidget* current = mWidgetStack->takeMainWidget();
297297
if ( current )
298298
{
299-
300299
if ( QgsLabelingWidget* widget = qobject_cast<QgsLabelingWidget*>( current ) )
301300
{
302301
mLabelingWidget = widget;

0 commit comments

Comments
 (0)
Please sign in to comment.