changeset 836:1384485650e3

Populate the fixed order layer list
author Chris Cannam
date Tue, 02 Sep 2014 15:20:23 +0100
parents 7792b7667f74
children 6c4cab21e387
files view/View.cpp
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/view/View.cpp	Tue Sep 02 14:47:04 2014 +0100
+++ b/view/View.cpp	Tue Sep 02 15:20:23 2014 +0100
@@ -532,6 +532,7 @@
     SingleColourLayer *scl = dynamic_cast<SingleColourLayer *>(layer);
     if (scl) scl->setDefaultColourFor(this);
 
+    m_fixedOrderLayers.push_back(layer);
     m_layerStack.push_back(layer);
 
     QProgressBar *pb = new QProgressBar(this);
@@ -599,7 +600,18 @@
     delete m_cache;
     m_cache = 0;
 
-    for (LayerList::iterator i = m_layerStack.begin(); i != m_layerStack.end(); ++i) {
+    for (LayerList::iterator i = m_fixedOrderLayers.begin();
+         i != m_fixedOrderLayers.end();
+         ++i) {
+	if (*i == layer) {
+	    m_fixedOrderLayers.erase(i);
+            break;
+        }
+    }
+
+    for (LayerList::iterator i = m_layerStack.begin(); 
+         i != m_layerStack.end();
+         ++i) {
 	if (*i == layer) {
 	    m_layerStack.erase(i);
 	    if (m_progressBars.find(layer) != m_progressBars.end()) {