diff data/model/SparseModel.h @ 333:1afaf98dbf11

* Factor out uses of "Sonic Visualiser" in "common" code to applicationName() * Add ability to show work title + artist in top-left of pane (thinking of Vect but may be useful in SV in future) * A few other generalisations useful for Vect
author Chris Cannam
date Fri, 09 Nov 2007 17:46:58 +0000
parents 7a4bd2c8585c
children f14e2f7b24f7 6f6ab834449d
line wrap: on
line diff
--- a/data/model/SparseModel.h	Wed Nov 07 14:53:12 2007 +0000
+++ b/data/model/SparseModel.h	Fri Nov 09 17:46:58 2007 +0000
@@ -127,7 +127,7 @@
         return ready;
     }
 
-    virtual void setCompletion(int completion);
+    virtual void setCompletion(int completion, bool update = true);
     virtual int getCompletion() const { return m_completion; }
 
     virtual bool hasTextLabels() const { return m_hasTextLabels; }
@@ -511,7 +511,7 @@
 
 template <typename PointType>
 void
-SparseModel<PointType>::setCompletion(int completion)
+SparseModel<PointType>::setCompletion(int completion, bool update)
 {
 //    std::cerr << "SparseModel::setCompletion(" << completion << ")" << std::endl;
 
@@ -529,7 +529,8 @@
 
 	} else if (!m_notifyOnAdd) {
 
-	    if (m_sinceLastNotifyMin >= 0 &&
+	    if (update &&
+                m_sinceLastNotifyMin >= 0 &&
 		m_sinceLastNotifyMax >= 0) {
 		emit modelChanged(m_sinceLastNotifyMin, m_sinceLastNotifyMax);
 		m_sinceLastNotifyMin = m_sinceLastNotifyMax = -1;