Fix grouping of locked items on undo/project load

parent 754f94ab
...@@ -1389,6 +1389,7 @@ void CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, bool ...@@ -1389,6 +1389,7 @@ void CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, bool
groupsList.insert(it); groupsList.insert(it);
} }
} }
bool lockGroup = false;
for (int i = 0; i < selection.count(); ++i) { for (int i = 0; i < selection.count(); ++i) {
if (selection.at(i)->type() == AVWidget || selection.at(i)->type() == TransitionWidget) { if (selection.at(i)->type() == AVWidget || selection.at(i)->type() == TransitionWidget) {
if (selection.at(i)->parentItem() && selection.at(i)->parentItem()->type() == GroupWidget) { if (selection.at(i)->parentItem() && selection.at(i)->parentItem()->type() == GroupWidget) {
...@@ -1401,7 +1402,8 @@ void CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, bool ...@@ -1401,7 +1402,8 @@ void CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, bool
} }
else { else {
AbstractClipItem *it = static_cast<AbstractClipItem *> (selection.at(i)); AbstractClipItem *it = static_cast<AbstractClipItem *> (selection.at(i));
if (!it || it->isItemLocked()) continue; if (!it) continue;
if (it->isItemLocked()) lockGroup = true;
itemsList.insert(selection.at(i)); itemsList.insert(selection.at(i));
} }
} }
...@@ -1453,6 +1455,8 @@ void CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, bool ...@@ -1453,6 +1455,8 @@ void CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, bool
foreach (QGraphicsItem *value, itemsList) { foreach (QGraphicsItem *value, itemsList) {
newGroup->addItem(value); newGroup->addItem(value);
} }
if (lockGroup)
newGroup->setItemLocked(true);
scene()->addItem(newGroup); scene()->addItem(newGroup);
KdenliveSettings::setSnaptopoints(snap); KdenliveSettings::setSnaptopoints(snap);
if (selectNewGroup) newGroup->setSelected(true); if (selectNewGroup) newGroup->setSelected(true);
......
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