From: joncruz Date: Mon, 5 Jun 2006 07:37:48 +0000 (+0000) Subject: Fixing crash on layer delete undo X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5f0df846794f48c96082fad56db4ab0f46b61559;p=inkscape.git Fixing crash on layer delete undo --- diff --git a/ChangeLog b/ChangeLog index fcf98a744..3ea0356ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-06-01 Jon A. Cruz + + * src/dialogs/layers-panel.h, src/dialogs/layers-panel.cpp: + + Blocked signal when changes are not from the layers UI. + Fixes bug #1495406. + 2006-06-02 Colin Marquardt * TRANSLATORS: Add Stefan Graubner. diff --git a/src/dialogs/layers-panel.cpp b/src/dialogs/layers-panel.cpp index 4faaec297..84de2fb86 100644 --- a/src/dialogs/layers-panel.cpp +++ b/src/dialogs/layers-panel.cpp @@ -442,15 +442,17 @@ void LayersPanel::_layersChanged() SPDocument* document = _desktop->doc(); SPObject* root = document->root; if ( root ) { + _selectedConnection.block(); if ( _mgr && _mgr->includes( root ) ) { SPObject* target = _desktop->currentLayer(); - _store->clear(); + _store->clear(); // TODO BIG FIX #if DUMP_LAYERS g_message("root:%p {%s} [%s]", root, root->id, root->label() ); #endif // DUMP_LAYERS _addLayer( document, root, 0, target, 0 ); } + _selectedConnection.unblock(); } } @@ -511,7 +513,7 @@ void LayersPanel::_pushTreeSelectionToCurrent() _mgr->setCurrentLayer( inTree ); } } else { - _mgr->setCurrentLayer( _desktop->doc()->root ); + _mgr->setCurrentLayer( _desktop->doc()->root ); // TODO BIG FIX } } } @@ -742,7 +744,7 @@ LayersPanel::LayersPanel() : _tree.set_expander_column( *_tree.get_column(nameColNum) ); - _tree.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &LayersPanel::_pushTreeSelectionToCurrent) ); + _selectedConnection = _tree.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &LayersPanel::_pushTreeSelectionToCurrent) ); _tree.get_selection()->set_select_function( sigc::mem_fun(*this, &LayersPanel::_rowSelectFunction) ); _tree.get_model()->signal_row_changed().connect( sigc::mem_fun(*this, &LayersPanel::_handleRowChange) ); diff --git a/src/dialogs/layers-panel.h b/src/dialogs/layers-panel.h index 76278fa4f..a600191e9 100644 --- a/src/dialogs/layers-panel.h +++ b/src/dialogs/layers-panel.h @@ -98,6 +98,9 @@ private: sigc::connection _removedConnection; sigc::connection _opacityConnection; + // Internal + sigc::connection _selectedConnection; + int _maxNestDepth; Inkscape::LayerManager* _mgr; SPDesktop* _desktop;