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
e5780eee
Commit
e5780eee
authored
Jan 05, 2021
by
Jean-Baptiste Mardelle
Browse files
Dragging an effect from a track to another should properly activate icon and create an undo entry.
Fixes
#909
parent
c25fa35a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/effects/effectstack/model/effectstackmodel.cpp
View file @
e5780eee
...
...
@@ -409,7 +409,7 @@ bool EffectStackModel::fromXml(const QDomElement &effectsXml, Fun &undo, Fun &re
return
effectAdded
;
}
bool
EffectStackModel
::
copyEffect
(
const
std
::
shared_ptr
<
AbstractEffectItem
>
&
sourceItem
,
PlaylistState
::
ClipState
state
)
bool
EffectStackModel
::
copyEffect
(
const
std
::
shared_ptr
<
AbstractEffectItem
>
&
sourceItem
,
PlaylistState
::
ClipState
state
,
bool
logUndo
)
{
QWriteLocker
locker
(
&
m_lock
);
if
(
sourceItem
->
childCount
()
>
0
)
{
...
...
@@ -467,6 +467,12 @@ bool EffectStackModel::copyEffect(const std::shared_ptr<AbstractEffectItem> &sou
emit
dataChanged
(
QModelIndex
(),
QModelIndex
(),
roles
);
return
true
;
};
update
();
if
(
logUndo
)
{
PUSH_LAMBDA
(
update
,
local_redo
);
PUSH_LAMBDA
(
update
,
local_undo
);
pCore
->
pushUndo
(
local_undo
,
local_redo
,
i18n
(
"Paste effect"
));
}
}
return
res
;
}
...
...
@@ -938,7 +944,7 @@ bool EffectStackModel::importEffects(const std::shared_ptr<EffectStackModel> &so
for
(
int
i
=
0
;
i
<
sourceStack
->
rowCount
();
i
++
)
{
auto
item
=
sourceStack
->
getEffectStackRow
(
i
);
// NO undo. this should only be used on project opening
if
(
copyEffect
(
item
,
state
))
{
if
(
copyEffect
(
item
,
state
,
false
))
{
found
=
true
;
if
(
item
->
isEnabled
())
{
effectEnabled
=
true
;
...
...
src/effects/effectstack/model/effectstackmodel.hpp
View file @
e5780eee
...
...
@@ -62,7 +62,7 @@ public:
bool
appendEffect
(
const
QString
&
effectId
,
bool
makeCurrent
=
false
);
/* @brief Copy an existing effect and append it at the bottom of the stack
*/
bool
copyEffect
(
const
std
::
shared_ptr
<
AbstractEffectItem
>
&
sourceItem
,
PlaylistState
::
ClipState
state
);
bool
copyEffect
(
const
std
::
shared_ptr
<
AbstractEffectItem
>
&
sourceItem
,
PlaylistState
::
ClipState
state
,
bool
logUndo
=
true
);
bool
copyXmlEffect
(
QDomElement
effect
);
/* @brief Import all effects from the given effect stack
*/
...
...
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