diff framework/Document.cpp @ 697:a27a6113fdd7

Restore/reimplement cancelAsyncLayerCreation - I had forgotten Tony uses it
author Chris Cannam
date Thu, 18 Jul 2019 14:12:00 +0100
parents bd6e2fc53377
children 7669c8cc869d
line wrap: on
line diff
--- a/framework/Document.cpp	Wed Jul 17 14:25:41 2019 +0100
+++ b/framework/Document.cpp	Thu Jul 18 14:12:00 2019 +0100
@@ -291,6 +291,12 @@
         delete this;
     }
 
+    void cancel() {
+        foreach (Layer *layer, m_primary) {
+            m_doc->setModel(layer, {});
+        }
+    }
+
 private:
     Document *m_doc;
     vector<Layer *> m_primary;
@@ -333,6 +339,13 @@
     return amc;
 }
 
+void
+Document::cancelAsyncLayerCreation(Document::LayerCreationAsyncHandle h)
+{
+    AdditionalModelConverter *conv = static_cast<AdditionalModelConverter *>(h);
+    conv->cancel();
+}
+
 vector<Layer *>
 Document::createLayersForDerivedModels(vector<ModelId> newModels, 
                                        QStringList names)