Fix crash when changing composition type of a grouped composition

parent 4a22be2c
...@@ -3563,6 +3563,13 @@ void TimelineModel::switchComposition(int cid, const QString &compoId) ...@@ -3563,6 +3563,13 @@ void TimelineModel::switchComposition(int cid, const QString &compoId)
int forcedTrack = compo->getForcedTrack(); int forcedTrack = compo->getForcedTrack();
Fun undo = []() { return true; }; Fun undo = []() { return true; };
Fun redo = []() { return true; }; Fun redo = []() { return true; };
// Clear selection
requestClearSelection(true);
if (m_groups->isInGroup(cid)) {
pCore->displayMessage(i18n("Cannot operate on grouped composition, please ungroup"), ErrorMessage);
return;
}
bool res = requestCompositionDeletion(cid, undo, redo); bool res = requestCompositionDeletion(cid, undo, redo);
int newId; int newId;
res = res && requestCompositionInsertion(compoId, currentTrack, a_track, currentPos, duration, nullptr, newId, undo, redo); res = res && requestCompositionInsertion(compoId, currentTrack, a_track, currentPos, duration, nullptr, newId, undo, redo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment