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
4b22fb81
Commit
4b22fb81
authored
Oct 22, 2022
by
Jean-Baptiste Mardelle
Browse files
Loading a project with locked tracks should not insert an entry in undo history
parent
37b5c938
Pipeline
#253632
passed with stage
in 8 minutes and 29 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/builders/meltBuilder.cpp
View file @
4b22fb81
...
...
@@ -258,7 +258,7 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
// load locked state as last step
for
(
int
tid
:
qAsConst
(
lockedTracksIndexes
))
{
timeline
->
set
Track
LockedState
(
tid
,
true
);
timeline
->
lock
Track
(
tid
,
true
);
}
if
(
!
ok
)
{
...
...
src/timeline2/model/timelinemodel.cpp
View file @
4b22fb81
...
...
@@ -6060,6 +6060,15 @@ bool TimelineModel::requestSetSelection(const std::unordered_set<int> &ids, Fun
return
false
;
}
void
TimelineModel
::
lockTrack
(
int
trackId
,
bool
lock
)
{
if
(
lock
)
{
getTrackById
(
trackId
)
->
lock
();
}
else
{
getTrackById
(
trackId
)
->
unlock
();
}
}
void
TimelineModel
::
setTrackLockedState
(
int
trackId
,
bool
lock
)
{
QWriteLocker
locker
(
&
m_lock
);
...
...
@@ -6068,11 +6077,11 @@ void TimelineModel::setTrackLockedState(int trackId, bool lock)
Fun
redo
=
[]()
{
return
true
;
};
Fun
lock_lambda
=
[
this
,
trackId
]()
{
get
Track
ById
(
trackId
)
->
lock
(
);
lock
Track
(
trackId
,
true
);
return
true
;
};
Fun
unlock_lambda
=
[
this
,
trackId
]()
{
get
Track
ById
(
trackId
)
->
unlock
(
);
lock
Track
(
trackId
,
false
);
return
true
;
};
if
(
lock
)
{
...
...
src/timeline2/model/timelinemodel.hpp
View file @
4b22fb81
...
...
@@ -459,6 +459,10 @@ public:
*/
const
QString
sceneList
(
const
QString
&
root
,
const
QString
&
fullPath
=
QString
(),
const
QString
&
filterData
=
QString
());
/** @brief Lock or unlock a track
*/
void
lockTrack
(
int
trackId
,
bool
lock
);
protected:
/** @brief Creates a new clip instance without inserting it.
This action is undoable, returns true on success
...
...
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