summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2006-06-05 07:37:48 +0000
committerjoncruz <joncruz@users.sourceforge.net>2006-06-05 07:37:48 +0000
commitd0ac4962cf8331bd752346f92ba70d55d262bf36 (patch)
tree277cfd586633560a38e72b49d393c9f2a7330397 /src
parentupdated (SIOX strings) (diff)
downloadinkscape-d0ac4962cf8331bd752346f92ba70d55d262bf36.tar.gz
inkscape-d0ac4962cf8331bd752346f92ba70d55d262bf36.zip
Fixing crash on layer delete undo
(bzr r1156)
Diffstat (limited to 'src')
-rw-r--r--src/dialogs/layers-panel.cpp8
-rw-r--r--src/dialogs/layers-panel.h3
2 files changed, 8 insertions, 3 deletions
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;