Skip to content

Commit

Permalink
[style dock] fix crash with undo widget
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Jul 2, 2016
1 parent 600ff4f commit 459fa8c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app/qgslayerstylingwidget.cpp
Expand Up @@ -139,6 +139,9 @@ void QgsLayerStylingWidget::setLayer( QgsMapLayer *layer )
}

mCurrentLayer = layer;

mUndoWidget->setUndoStack( layer->undoStackStyles() );

connect( mCurrentLayer, SIGNAL( styleChanged() ), this, SLOT( updateCurrentWidgetLayer() ) );

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

mBlockAutoApply = true;

mUndoWidget->setUndoStack( mCurrentLayer->undoStackStyles() );

whileBlocking( mLayerCombo )->setLayer( mCurrentLayer );

int row = mOptionsListWidget->currentIndex().row();
Expand All @@ -296,7 +296,6 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
QgsPanelWidget* current = mWidgetStack->takeMainWidget();
if ( current )
{

if ( QgsLabelingWidget* widget = qobject_cast<QgsLabelingWidget*>( current ) )
{
mLabelingWidget = widget;
Expand Down

0 comments on commit 459fa8c

Please sign in to comment.