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
259
Issues
259
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
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
cee0ad80
Commit
cee0ad80
authored
Dec 02, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spacer crash regression introduced in recent commit
parent
1e365f42
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
src/timeline2/model/groupsmodel.cpp
src/timeline2/model/groupsmodel.cpp
+10
-1
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+2
-2
src/timeline2/model/timelinemodel.hpp
src/timeline2/model/timelinemodel.hpp
+3
-3
No files found.
src/timeline2/model/groupsmodel.cpp
View file @
cee0ad80
...
...
@@ -148,7 +148,6 @@ 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
;
...
...
@@ -540,6 +539,7 @@ bool GroupsModel::split(int id, const std::function<bool(int)> &criterion, Fun &
// At each iteration, we create a new node by grouping together elements that are either leaves or already created nodes.
std
::
unordered_map
<
int
,
int
>
created_id
;
// to keep track of node that we create
std
::
vector
<
int
>
newGroups
;
while
(
!
new_groups
.
empty
())
{
int
selected
=
INT_MAX
;
for
(
const
auto
&
group
:
new_groups
)
{
...
...
@@ -563,6 +563,7 @@ bool GroupsModel::split(int id, const std::function<bool(int)> &criterion, Fun &
}
Q_ASSERT
(
new_types
.
count
(
selected
)
!=
0
);
int
gid
=
groupItems
(
group
,
undo
,
redo
,
new_types
[
selected
],
true
);
newGroups
.
push_back
(
gid
);
created_id
[
selected
]
=
gid
;
new_groups
.
erase
(
selected
);
}
...
...
@@ -575,6 +576,14 @@ bool GroupsModel::split(int id, const std::function<bool(int)> &criterion, Fun &
mergeSingleGroups
(
created_id
[
corresp
[
id
]],
undo
,
redo
);
}
}
Fun
clear_group_selection
=
[
this
,
newGroups
]()
{
if
(
auto
ptr
=
m_parent
.
lock
())
{
// Ensure one of the deleted group was not selected
ptr
->
clearGroupSelectionOnDelete
(
newGroups
);
}
return
true
;
};
PUSH_FRONT_LAMBDA
(
clear_group_selection
,
undo
);
return
res
;
}
...
...
src/timeline2/model/timelinemodel.cpp
View file @
cee0ad80
...
...
@@ -4878,10 +4878,10 @@ void TimelineModel::requestClearSelection(bool onDeletion, Fun &undo, Fun &redo)
}
}
void
TimelineModel
::
clearGroupSelectionOnDelete
(
int
gid
)
void
TimelineModel
::
clearGroupSelectionOnDelete
(
std
::
vector
<
int
>
groups
)
{
READ_LOCK
();
if
(
gid
==
m_currentSelection
)
{
if
(
std
::
find
(
groups
.
begin
(),
groups
.
end
(),
m_currentSelection
)
!=
groups
.
end
()
)
{
requestClearSelection
(
true
);
}
}
...
...
src/timeline2/model/timelinemodel.hpp
View file @
cee0ad80
...
...
@@ -690,10 +690,10 @@ public:
*/
Q_INVOKABLE
bool
requestClearSelection
(
bool
onDeletion
=
false
);
/** @brief On group
deletion, ensure the group was
not selected, clear selection otherwise
@param g
id The group id
/** @brief On group
s deletion, ensure the groups were
not selected, clear selection otherwise
@param g
roups The group ids
*/
void
clearGroupSelectionOnDelete
(
int
gid
);
void
clearGroupSelectionOnDelete
(
std
::
vector
<
int
>
groups
);
// 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