Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
051f3bcf
Commit
051f3bcf
authored
May 15, 2020
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
051f3bcf
...
...
@@ -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
)
{
item
->
setRating
(
rating
);
emit
m_itemModel
->
dataChanged
(
index
,
index
,
{
AbstractProjectItem
::
DataRating
});
uint
previousRating
=
item
->
rating
();
Fun
undo
=
[
this
,
item
,
index
,
previousRating
]()
{
item
->
setRating
(
previousRating
);
emit
m_itemModel
->
dataChanged
(
index
,
index
,
{
AbstractProjectItem
::
DataRating
});
return
true
;
};
Fun
redo
=
[
this
,
item
,
index
,
rating
]()
{
item
->
setRating
(
rating
);
emit
m_itemModel
->
dataChanged
(
index
,
index
,
{
AbstractProjectItem
::
DataRating
});
return
true
;
};
redo
();
pCore
->
pushUndo
(
undo
,
redo
,
i18n
(
"Edit rating"
));
}
else
{
emit
displayBinMessage
(
i18n
(
"Cannot set rating on this item"
),
KMessageWidget
::
Information
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment