Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
252
Issues
252
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
c3015707
Commit
c3015707
authored
Nov 23, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix group subtitle deletion undo
parent
824741bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+6
-7
No files found.
src/timeline2/model/timelinemodel.cpp
View file @
c3015707
...
...
@@ -1915,10 +1915,7 @@ bool TimelineModel::requestSubtitleDeletion(int clipId, Fun &undo, Fun &redo)
GenTime
end
=
sub
.
end
();
QString
text
=
sub
.
subtitle
();
Fun
reverse
=
[
this
,
clipId
,
start
,
end
,
text
]()
{
// We capture a shared_ptr to the clip, which means that as long as this undo object lives, the clip object is not deleted. To insert it back it is
// sufficient to register it.
m_subtitleModel
->
addSubtitle
(
clipId
,
start
,
end
,
text
);
return
true
;
return
m_subtitleModel
->
addSubtitle
(
clipId
,
start
,
end
,
text
);
};
if
(
operation
())
{
UPDATE_UNDO_REDO
(
operation
,
reverse
,
undo
,
redo
);
...
...
@@ -2541,7 +2538,8 @@ bool TimelineModel::requestGroupDeletion(int clipId, Fun &undo, Fun &redo)
group_queue
.
push
(
m_groups
->
getRootId
(
clipId
));
std
::
unordered_set
<
int
>
all_items
;
std
::
unordered_set
<
int
>
all_compositions
;
std
::
unordered_set
<
int
>
all_subtitles
;
// Subtitles MUST BE SORTED BY REVERSE timeline id to preserve the qml model index on undo!!
std
::
set
<
int
>
all_subtitles
;
while
(
!
group_queue
.
empty
())
{
int
current_group
=
group_queue
.
front
();
bool
isSelection
=
m_currentSelection
==
current_group
;
...
...
@@ -2598,8 +2596,9 @@ bool TimelineModel::requestGroupDeletion(int clipId, Fun &undo, Fun &redo)
return
false
;
}
}
for
(
int
sub
:
all_subtitles
)
{
bool
res
=
requestSubtitleDeletion
(
sub
,
undo
,
redo
);
std
::
set
<
int
>::
reverse_iterator
rit
;
for
(
rit
=
all_subtitles
.
rbegin
();
rit
!=
all_subtitles
.
rend
();
++
rit
)
{
bool
res
=
requestSubtitleDeletion
(
*
rit
,
undo
,
redo
);
if
(
!
res
)
{
undo
();
return
false
;
...
...
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