changeset 339:dd07d48d7d4f tonioni

Restore dormancy with layer
author Chris Cannam
date Tue, 01 Apr 2014 13:27:44 +0100
parents 3144af512ea3
children c11701af6bb4 93cf23bfa1cb
files framework/Document.cpp framework/Document.h
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/framework/Document.cpp	Tue Mar 11 14:54:28 2014 +0000
+++ b/framework/Document.cpp	Tue Apr 01 13:27:44 2014 +0100
@@ -1193,6 +1193,7 @@
     m_d(d),
     m_view(view),
     m_layer(layer),
+    m_wasDormant(layer->isLayerDormant(view)),
     m_name(qApp->translate("RemoveLayerCommand", "Delete %1 Layer").arg(layer->objectName())),
     m_added(true)
 {
@@ -1246,7 +1247,7 @@
 Document::RemoveLayerCommand::unexecute()
 {
     m_view->addLayer(m_layer);
-    m_layer->setLayerDormant(m_view, false);
+    m_layer->setLayerDormant(m_view, m_wasDormant);
 
     m_d->addToLayerViewMap(m_layer, m_view);
     m_added = true;
--- a/framework/Document.h	Tue Mar 11 14:54:28 2014 +0000
+++ b/framework/Document.h	Tue Apr 01 13:27:44 2014 +0100
@@ -377,6 +377,7 @@
 	Document *m_d;
 	View *m_view; // I don't own this
 	Layer *m_layer; // Document owns this, but I determine its lifespan
+        bool m_wasDormant;
 	QString m_name;
 	bool m_added;
     };