Commit 051f3bcf authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

integrate clip rating with undo/redo.

BUG: 421552
parent 13f180f9
Pipeline #20233 passed with stage
in 9 minutes and 26 seconds
......@@ -1992,8 +1992,19 @@ void Bin::slotInitView(QAction *action)
const QModelIndex index = m_proxyModel->mapToSource(ix);
std::shared_ptr<AbstractProjectItem> item = m_itemModel->getBinItemByIndex(index);
if (item) {
uint previousRating = item->rating();
Fun undo = [this, item, index, previousRating]() {
emit m_itemModel->dataChanged(index, index, {AbstractProjectItem::DataRating});
return true;
Fun redo = [this, item, index, rating]() {
emit m_itemModel->dataChanged(index, index, {AbstractProjectItem::DataRating});
return true;
pCore->pushUndo(undo, redo, i18n("Edit rating"));
} else {
emit displayBinMessage(i18n("Cannot set rating on this item"), KMessageWidget::Information);
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