diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2020-07-12 18:58:54 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2020-07-12 18:59:13 +0200 |
commit | d3fdf11d0f5ee324c0199ae836878c355d28da61 (patch) | |
tree | 0574a4772776bb0de19cb6fb902afdc838d892c8 /src/track | |
parent | 72b6b645494dd39fe53ea5a219aa84d1cdb76293 (diff) |
Reset track id of cue objects when removing from track
Diffstat (limited to 'src/track')
-rw-r--r-- | src/track/track.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/track/track.cpp b/src/track/track.cpp index 41d8984282..2748ed3b0d 100644 --- a/src/track/track.cpp +++ b/src/track/track.cpp @@ -841,16 +841,18 @@ CuePointer Track::findCueById(int id) const { } void Track::removeCue(const CuePointer& pCue) { - if (pCue == nullptr) { + if (!pCue) { return; } QMutexLocker lock(&m_qMutex); + DEBUG_ASSERT(pCue->getTrackId() == m_record.getId()); disconnect(pCue.get(), 0, this, 0); m_cuePoints.removeOne(pCue); if (pCue->getType() == mixxx::CueType::MainCue) { m_record.setCuePoint(CuePosition()); } + pCue->setTrackId(TrackId()); markDirtyAndUnlock(&lock); emit cuesUpdated(); } @@ -864,6 +866,7 @@ void Track::removeCuesOfType(mixxx::CueType type) { // FIXME: Why does this only work for the Hotcue Type? if (pCue->getType() == type) { disconnect(pCue.get(), 0, this, 0); + pCue->setTrackId(TrackId()); it.remove(); dirty = true; } @@ -949,6 +952,7 @@ void Track::setCuePointsMarkDirtyAndUnlock( // disconnect existing cue points for (const auto& pCue: m_cuePoints) { disconnect(pCue.get(), 0, this, 0); + pCue->setTrackId(TrackId()); } m_cuePoints = cuePoints; // connect new cue points |