Fix crash on razor with multiple clips selected

BUG: 376082
parent 885fb4d0
......@@ -4315,6 +4315,8 @@ void CustomTrackView::cutSelectedClips(QList<QGraphicsItem *> itemList, GenTime
if (under)
itemList << under;
}
QUndoCommand *command = new QUndoCommand;
command->setText(i18n("Razor clip"));
for (int i = 0; i < itemList.count(); ++i) {
if (!itemList.at(i))
continue;
......@@ -4325,8 +4327,7 @@ void CustomTrackView::cutSelectedClips(QList<QGraphicsItem *> itemList, GenTime
if (!groups.contains(group))
groups << group;
} else if (currentPos > item->startPos() && currentPos < item->endPos()) {
RazorClipCommand *command = new RazorClipCommand(this, item->info(), item->effectList(), currentPos);
m_commandStack->push(command);
new RazorClipCommand(this, item->info(), item->effectList(), currentPos, true, command);
}
} else if (itemList.at(i)->type() == GroupWidget && itemList.at(i) != m_selectionGroup) {
AbstractGroupItem *group = static_cast<AbstractGroupItem *>(itemList.at(i));
......@@ -4334,6 +4335,11 @@ void CustomTrackView::cutSelectedClips(QList<QGraphicsItem *> itemList, GenTime
groups << group;
}
}
if (command->childCount() > 0) {
m_commandStack->push(command);
} else {
delete command;
}
for (int i = 0; i < groups.count(); ++i)
razorGroup(groups.at(i), currentPos);
......
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