Skip to content
GitLab
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
aa6e502b
Commit
aa6e502b
authored
Jun 15, 2019
by
Jean-Baptiste Mardelle
Browse files
Fix crash on group cut. Fixes
#256
parent
d2bb75f4
Pipeline
#4358
passed with stage
in 20 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinefunctions.cpp
View file @
aa6e502b
...
@@ -169,11 +169,12 @@ bool TimelineFunctions::requestClipCut(const std::shared_ptr<TimelineItemModel>
...
@@ -169,11 +169,12 @@ bool TimelineFunctions::requestClipCut(const std::shared_ptr<TimelineItemModel>
clips
.
insert
(
cid
);
clips
.
insert
(
cid
);
}
}
}
}
// We need to call clearSelection before attempting the split or the group split will be corrupted by the selection group (no undo support)
timeline
->
requestClearSelection
();
std
::
unordered_set
<
int
>
topElements
;
std
::
unordered_set
<
int
>
topElements
;
std
::
transform
(
clips
.
begin
(),
clips
.
end
(),
std
::
inserter
(
topElements
,
topElements
.
begin
()),
[
&
](
int
id
)
{
return
timeline
->
m_groups
->
getRootId
(
id
);
});
std
::
transform
(
clips
.
begin
(),
clips
.
end
(),
std
::
inserter
(
topElements
,
topElements
.
begin
()),
[
&
](
int
id
)
{
return
timeline
->
m_groups
->
getRootId
(
id
);
});
// We need to call clearSelection before attempting the split or the group split will be corrupted by the selection group (no undo support)
timeline
->
requestClearSelection
();
int
count
=
0
;
int
count
=
0
;
QList
<
int
>
newIds
;
QList
<
int
>
newIds
;
int
mainId
=
-
1
;
int
mainId
=
-
1
;
...
@@ -210,6 +211,7 @@ bool TimelineFunctions::requestClipCut(const std::shared_ptr<TimelineItemModel>
...
@@ -210,6 +211,7 @@ bool TimelineFunctions::requestClipCut(const std::shared_ptr<TimelineItemModel>
auto
criterion
=
[
timeline
,
position
](
int
cid
)
{
return
timeline
->
getClipPosition
(
cid
)
<
position
;
};
auto
criterion
=
[
timeline
,
position
](
int
cid
)
{
return
timeline
->
getClipPosition
(
cid
)
<
position
;
};
bool
res
=
true
;
bool
res
=
true
;
for
(
const
int
topId
:
topElements
)
{
for
(
const
int
topId
:
topElements
)
{
qDebug
()
<<
"// CHECKING REGROUP ELMENT: "
<<
topId
<<
", ISCLIP: "
<<
timeline
->
isClip
(
topId
)
<<
timeline
->
isGroup
(
topId
);
res
=
res
&&
timeline
->
m_groups
->
split
(
topId
,
criterion
,
undo
,
redo
);
res
=
res
&&
timeline
->
m_groups
->
split
(
topId
,
criterion
,
undo
,
redo
);
}
}
if
(
!
res
)
{
if
(
!
res
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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