diff document/SVFileReader.cpp @ 84:41c491657587

* Further fix for restoring layer visibility from session file * Better handling of error state in bzip file device to avoid spurious errors * Fix #1495001 deleted layers prevail in saved session file
author Chris Cannam
date Fri, 05 Jan 2007 15:49:10 +0000
parents 0d2fb43b5ee5
children 8944f3005a15
line wrap: on
line diff
--- a/document/SVFileReader.cpp	Fri Jan 05 14:46:45 2007 +0000
+++ b/document/SVFileReader.cpp	Fri Jan 05 15:49:10 2007 +0000
@@ -791,7 +791,22 @@
     }
 
     if (!m_inData && m_currentPane) {
+
+        QString visible = attributes.value("visible");
+        bool dormant = (visible == "false");
+
+        // We need to do this both before and after adding the layer
+        // to the view -- we need it to be dormant if appropriate
+        // before it's actually added to the view so that any property
+        // box gets the right state when it's added, but the add layer
+        // command sets dormant to false because it assumes it may be
+        // restoring a previously dormant layer, so we need to set it
+        // again afterwards too.  Hm
+        layer->setLayerDormant(m_currentPane, dormant);
+
 	m_document->addLayerToView(m_currentPane, layer);
+
+        layer->setLayerDormant(m_currentPane, dormant);
     }
 
     return true;