changeset 1767:aa0b56d72f27

Ensure the right model ID gets sent with the signal for alignment changes
author Chris Cannam
date Thu, 18 Jul 2019 13:17:49 +0100
parents 85b9b466a59f
children 4fec4527e50e
files data/model/Model.cpp data/model/Model.h
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/Model.cpp	Wed Jul 17 14:24:51 2019 +0100
+++ b/data/model/Model.cpp	Thu Jul 18 13:17:49 2019 +0100
@@ -47,17 +47,23 @@
 
     if (auto model = ModelById::get(m_alignmentModel)) {
         disconnect(model.get(), SIGNAL(completionChanged(ModelId)),
-                   this, SIGNAL(alignmentCompletionChanged(ModelId)));
+                   this, SLOT(alignmentModelCompletionChanged(ModelId)));
     }
     
     m_alignmentModel = alignmentModel;
 
     if (auto model = ModelById::get(m_alignmentModel)) {
         connect(model.get(), SIGNAL(completionChanged(ModelId)),
-                this, SIGNAL(alignmentCompletionChanged(ModelId)));
+                this, SLOT(alignmentModelCompletionChanged(ModelId)));
     }
 }
 
+void
+Model::alignmentModelCompletionChanged(ModelId)
+{
+    emit alignmentCompletionChanged(getId());
+}
+
 const ModelId
 Model::getAlignment() const
 {
--- a/data/model/Model.h	Wed Jul 17 14:24:51 2019 +0100
+++ b/data/model/Model.h	Thu Jul 18 13:17:49 2019 +0100
@@ -292,10 +292,14 @@
 
     /**
      * Emitted when the completion percentage changes for the
-     * calculation of this model's alignment model.
+     * calculation of this model's alignment model. (The ModelId
+     * provided is that of this model, not the alignment model.)
      */
     void alignmentCompletionChanged(ModelId myId);
 
+private slots:
+    void alignmentModelCompletionChanged(ModelId);
+    
 protected:
     Model() :
         m_extendTo(0) { }