diff data/model/ReadOnlyWaveFileModel.cpp @ 1752:6d09d68165a4 by-id

Further review of ById: make IDs only available when adding a model to the ById store, not by querying the item directly. This means any id encountered in the wild must have been added to the store at some point (even if later released), which simplifies reasoning about lifecycles
author Chris Cannam
date Fri, 05 Jul 2019 15:28:07 +0100
parents 77543124651b
children 73447d746db3
line wrap: on
line diff
--- a/data/model/ReadOnlyWaveFileModel.cpp	Thu Jul 04 18:04:21 2019 +0100
+++ b/data/model/ReadOnlyWaveFileModel.cpp	Fri Jul 05 15:28:07 2019 +0100
@@ -590,14 +590,14 @@
         SVDEBUG << "ReadOnlyWaveFileModel(" << objectName() << ")::fillTimerTimedOut: extent = " << fillExtent << endl;
 #endif
         if (fillExtent > m_lastFillExtent) {
-            emit modelChangedWithin(m_lastFillExtent, fillExtent);
+            emit modelChangedWithin(getId(), m_lastFillExtent, fillExtent);
             m_lastFillExtent = fillExtent;
         }
     } else {
 #ifdef DEBUG_WAVE_FILE_MODEL
         SVDEBUG << "ReadOnlyWaveFileModel(" << objectName() << ")::fillTimerTimedOut: no thread" << endl;
 #endif
-        emit modelChanged();
+        emit modelChanged(getId());
     }
 }
 
@@ -616,10 +616,10 @@
     SVDEBUG << "ReadOnlyWaveFileModel(" << objectName() << ")::cacheFilled, about to emit things" << endl;
 #endif
     if (getEndFrame() > prevFillExtent) {
-        emit modelChangedWithin(prevFillExtent, getEndFrame());
+        emit modelChangedWithin(getId(), prevFillExtent, getEndFrame());
     }
-    emit modelChanged();
-    emit ready();
+    emit modelChanged(getId());
+    emit ready(getId());
 }
 
 void