Mercurial > hg > svcore
comparison data/model/ImageModel.h @ 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 | 52705a328b34 |
children | 13bd41bd8a17 |
comparison
equal
deleted
inserted
replaced
1751:77543124651b | 1752:6d09d68165a4 |
---|---|
46 int resolution, | 46 int resolution, |
47 bool notifyOnAdd = true) : | 47 bool notifyOnAdd = true) : |
48 m_sampleRate(sampleRate), | 48 m_sampleRate(sampleRate), |
49 m_resolution(resolution), | 49 m_resolution(resolution), |
50 m_notifier(this, | 50 m_notifier(this, |
51 getId(), | |
51 notifyOnAdd ? | 52 notifyOnAdd ? |
52 DeferredNotifier::NOTIFY_ALWAYS : | 53 DeferredNotifier::NOTIFY_ALWAYS : |
53 DeferredNotifier::NOTIFY_DEFERRED), | 54 DeferredNotifier::NOTIFY_DEFERRED), |
54 m_completion(100) { | 55 m_completion(100) { |
55 } | 56 } |
82 | 83 |
83 if (update) { | 84 if (update) { |
84 m_notifier.makeDeferredNotifications(); | 85 m_notifier.makeDeferredNotifications(); |
85 } | 86 } |
86 | 87 |
87 emit completionChanged(); | 88 emit completionChanged(getId()); |
88 | 89 |
89 if (completion == 100) { | 90 if (completion == 100) { |
90 // henceforth: | 91 // henceforth: |
91 m_notifier.switchMode(DeferredNotifier::NOTIFY_ALWAYS); | 92 m_notifier.switchMode(DeferredNotifier::NOTIFY_ALWAYS); |
92 emit modelChanged(); | 93 emit modelChanged(getId()); |
93 } | 94 } |
94 } | 95 } |
95 | 96 |
96 /** | 97 /** |
97 * Query methods. | 98 * Query methods. |
150 | 151 |
151 void remove(Event e) override { | 152 void remove(Event e) override { |
152 { QMutexLocker locker(&m_mutex); | 153 { QMutexLocker locker(&m_mutex); |
153 m_events.remove(e); | 154 m_events.remove(e); |
154 } | 155 } |
155 emit modelChangedWithin(e.getFrame(), e.getFrame() + m_resolution); | 156 emit modelChangedWithin(getId(), |
157 e.getFrame(), e.getFrame() + m_resolution); | |
156 } | 158 } |
157 | 159 |
158 /** | 160 /** |
159 * TabularModel methods. | 161 * TabularModel methods. |
160 */ | 162 */ |