Mercurial > hg > svcore
comparison data/model/ImageModel.h @ 1766:85b9b466a59f
Merge from branch by-id
author | Chris Cannam |
---|---|
date | Wed, 17 Jul 2019 14:24:51 +0100 |
parents | 6d09d68165a4 |
children | 13bd41bd8a17 |
comparison
equal
deleted
inserted
replaced
1730:649ac57c5a2d | 1766:85b9b466a59f |
---|---|
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 */ |
229 case 1: e1 = e0.withFrame(value.toInt()); break; | 231 case 1: e1 = e0.withFrame(value.toInt()); break; |
230 case 2: e1 = e0.withURI(value.toString()); break; | 232 case 2: e1 = e0.withURI(value.toString()); break; |
231 case 3: e1 = e0.withLabel(value.toString()); break; | 233 case 3: e1 = e0.withLabel(value.toString()); break; |
232 } | 234 } |
233 | 235 |
234 ChangeEventsCommand *command = | 236 auto command = new ChangeEventsCommand(getId().untyped, tr("Edit Data")); |
235 new ChangeEventsCommand(this, tr("Edit Data")); | |
236 command->remove(e0); | 237 command->remove(e0); |
237 command->add(e1); | 238 command->add(e1); |
238 return command->finish(); | 239 return command->finish(); |
239 } | 240 } |
240 | 241 |