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
9a8de2e4
Commit
9a8de2e4
authored
Jun 21, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup in clip/composition resize UI update
parent
c4153484
Pipeline
#4487
passed with stage
in 14 minutes and 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
27 deletions
+19
-27
src/timeline2/model/compositionmodel.cpp
src/timeline2/model/compositionmodel.cpp
+19
-13
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+0
-14
No files found.
src/timeline2/model/compositionmodel.cpp
View file @
9a8de2e4
...
...
@@ -116,28 +116,34 @@ bool CompositionModel::requestResize(int size, bool right, Fun &undo, Fun &redo,
// Perform resize only
setInOut
(
in
,
out
);
}
Fun
operation
=
[
track_operation
]()
{
QVector
<
int
>
roles
{
TimelineModel
::
DurationRole
};
if
(
!
right
)
{
roles
.
push_back
(
TimelineModel
::
StartRole
);
}
Fun
operation
=
[
this
,
track_operation
,
roles
]()
{
if
(
track_operation
())
{
// we send a list of roles to be updated
if
(
auto
ptr
=
m_parent
.
lock
())
{
QModelIndex
ix
=
ptr
->
makeCompositionIndexFromID
(
m_id
);
ptr
->
dataChanged
(
ix
,
ix
,
roles
);
}
return
true
;
}
return
false
;
};
if
(
operation
())
{
// Now, we are in the state in which the timeline should be when we try to revert current action. So we can build the reverse action from here
auto
ptr
=
m_parent
.
lock
();
// we send a list of roles to be updated
QVector
<
int
>
roles
{
TimelineModel
::
DurationRole
};
if
(
!
right
)
{
roles
.
push_back
(
TimelineModel
::
StartRole
);
}
if
(
m_currentTrackId
!=
-
1
&&
ptr
)
{
QModelIndex
ix
=
ptr
->
makeCompositionIndexFromID
(
m_id
);
// TODO: integrate in undo
ptr
->
dataChanged
(
ix
,
ix
,
roles
);
track_reverse
=
ptr
->
getTrackById
(
m_currentTrackId
)
->
requestCompositionResize_lambda
(
m_id
,
old_in
,
old_out
,
logUndo
);
if
(
m_currentTrackId
!=
-
1
)
{
if
(
auto
ptr
=
m_parent
.
lock
())
{
track_reverse
=
ptr
->
getTrackById
(
m_currentTrackId
)
->
requestCompositionResize_lambda
(
m_id
,
old_in
,
old_out
,
logUndo
);
}
}
Fun
reverse
=
[
t
rack_reverse
]()
{
Fun
reverse
=
[
t
his
,
track_reverse
,
roles
]()
{
if
(
track_reverse
())
{
if
(
auto
ptr
=
m_parent
.
lock
())
{
QModelIndex
ix
=
ptr
->
makeCompositionIndexFromID
(
m_id
);
ptr
->
dataChanged
(
ix
,
ix
,
roles
);
}
return
true
;
}
return
false
;
...
...
src/timeline2/model/timelinemodel.cpp
View file @
9a8de2e4
...
...
@@ -1781,15 +1781,6 @@ bool TimelineModel::requestItemResize(int itemId, int size, bool right, bool log
{
Fun
local_undo
=
[]()
{
return
true
;
};
Fun
local_redo
=
[]()
{
return
true
;
};
Fun
update_model
=
[
itemId
,
right
,
logUndo
,
this
]()
{
Q_ASSERT
(
isItem
(
itemId
));
if
(
getItemTrackId
(
itemId
)
!=
-
1
)
{
qDebug
()
<<
"++++++++++
\n
RESIZING ITEM: "
<<
itemId
<<
"
\n
+++++++"
;
QModelIndex
modelIndex
=
isClip
(
itemId
)
?
makeClipIndexFromID
(
itemId
)
:
makeCompositionIndexFromID
(
itemId
);
notifyChange
(
modelIndex
,
modelIndex
,
!
right
,
true
,
logUndo
);
}
return
true
;
};
bool
result
=
false
;
if
(
isClip
(
itemId
))
{
result
=
m_allClips
[
itemId
]
->
requestResize
(
size
,
right
,
local_undo
,
local_redo
,
logUndo
);
...
...
@@ -1798,11 +1789,6 @@ bool TimelineModel::requestItemResize(int itemId, int size, bool right, bool log
result
=
m_allCompositions
[
itemId
]
->
requestResize
(
size
,
right
,
local_undo
,
local_redo
,
logUndo
);
}
if
(
result
)
{
if
(
!
blockUndo
)
{
PUSH_LAMBDA
(
update_model
,
local_undo
);
}
PUSH_LAMBDA
(
update_model
,
local_redo
);
update_model
();
UPDATE_UNDO_REDO
(
local_redo
,
local_undo
,
undo
,
redo
);
}
return
result
;
...
...
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