Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
f9a2a14d
Commit
f9a2a14d
authored
Feb 23, 2018
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix effects inserted in wrong row after deletion undo
parent
00b0e45a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
src/abstractmodel/abstracttreemodel.cpp
src/abstractmodel/abstracttreemodel.cpp
+2
-2
src/abstractmodel/abstracttreemodel.hpp
src/abstractmodel/abstracttreemodel.hpp
+1
-1
src/effects/effectstack/model/effectstackmodel.cpp
src/effects/effectstack/model/effectstackmodel.cpp
+5
-0
No files found.
src/abstractmodel/abstracttreemodel.cpp
View file @
f9a2a14d
...
...
@@ -315,13 +315,13 @@ Fun AbstractTreeModel::removeItem_lambda(int id)
};
}
Fun
AbstractTreeModel
::
moveItem_lambda
(
int
id
,
int
destRow
)
Fun
AbstractTreeModel
::
moveItem_lambda
(
int
id
,
int
destRow
,
bool
force
)
{
Fun
lambda
=
[]()
{
return
true
;
};
std
::
vector
<
std
::
shared_ptr
<
TreeItem
>>
oldStack
;
auto
item
=
getItemById
(
id
);
if
(
item
->
row
()
==
destRow
)
{
if
(
!
force
&&
item
->
row
()
==
destRow
)
{
// nothing to do
return
lambda
;
}
...
...
src/abstractmodel/abstracttreemodel.hpp
View file @
f9a2a14d
...
...
@@ -76,7 +76,7 @@ public:
Fun
removeItem_lambda
(
int
id
);
/* @brief Helper function to generate a lambda that changes the row of an item */
Fun
moveItem_lambda
(
int
id
,
int
destRow
);
Fun
moveItem_lambda
(
int
id
,
int
destRow
,
bool
force
=
false
);
/* @brief Returns the number of clips in bin */
int
clipsCount
()
const
;
...
...
src/effects/effectstack/model/effectstackmodel.cpp
View file @
f9a2a14d
...
...
@@ -95,7 +95,12 @@ void EffectStackModel::removeEffect(std::shared_ptr<EffectItemModel> effect)
srv
->
set
(
"kdenlive:activeeffect"
,
--
current
);
}
}
int
currentRow
=
effect
->
row
();
Fun
undo
=
addItem_lambda
(
effect
,
parentId
);
if
(
currentRow
!=
rowCount
()
-
1
)
{
Fun
move
=
moveItem_lambda
(
effect
->
getId
(),
currentRow
,
true
);
PUSH_LAMBDA
(
move
,
undo
);
}
Fun
redo
=
removeItem_lambda
(
effect
->
getId
());
bool
res
=
redo
();
if
(
res
)
{
...
...
Write
Preview
Markdown
is supported
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