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
7502d82e
Commit
7502d82e
authored
Dec 02, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix crash undoing cut when left part was selected
parent
4d325cbd
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/groupsmodel.cpp
View file @
7502d82e
...
...
@@ -148,6 +148,7 @@ Fun GroupsModel::destructGroupItem_lambda(int id)
removeFromGroup
(
id
);
auto
ptr
=
m_parent
.
lock
();
if
(
!
ptr
)
Q_ASSERT
(
false
);
ptr
->
clearGroupSelectionOnDelete
(
id
);
for
(
int
child
:
m_downLink
[
id
])
{
m_upLink
[
child
]
=
-
1
;
QModelIndex
ix
;
...
...
src/timeline2/model/timelinefunctions.cpp
View file @
7502d82e
...
...
@@ -266,7 +266,7 @@ bool TimelineFunctions::requestClipCut(const std::shared_ptr<TimelineItemModel>
int
newClip
=
timeline
->
getClipByPosition
(
trackToSelect
,
position
);
if
(
newClip
>
-
1
)
{
timeline
->
requestSetSelection
({
newClip
});
}
}
}
return
count
>
0
;
}
...
...
src/timeline2/model/timelinemodel.cpp
View file @
7502d82e
...
...
@@ -4878,6 +4878,15 @@ void TimelineModel::requestClearSelection(bool onDeletion, Fun &undo, Fun &redo)
}
}
void
TimelineModel
::
clearGroupSelectionOnDelete
(
int
gid
)
{
READ_LOCK
();
if
(
gid
==
m_currentSelection
)
{
requestClearSelection
(
true
);
}
}
std
::
unordered_set
<
int
>
TimelineModel
::
getCurrentSelection
()
const
{
READ_LOCK
();
...
...
src/timeline2/model/timelinemodel.hpp
View file @
7502d82e
...
...
@@ -689,6 +689,11 @@ public:
@param onDeletion is true when the selection is cleared as a result of a deletion
*/
Q_INVOKABLE
bool
requestClearSelection
(
bool
onDeletion
=
false
);
/** @brief On group deletion, ensure the group was not selected, clear selection otherwise
@param gid The group id
*/
void
clearGroupSelectionOnDelete
(
int
gid
);
// same function with undo/redo accumulation
void
requestClearSelection
(
bool
onDeletion
,
Fun
&
undo
,
Fun
&
redo
);
...
...
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