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
b86e9224
Commit
b86e9224
authored
Jan 18, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix corruption on group move and fix timeline seek when shift pressed.
Fixes
#529
parent
bc0aea92
Pipeline
#13436
passed with stage
in 17 minutes and 48 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
b86e9224
...
...
@@ -2443,6 +2443,7 @@ Fun TimelineModel::deregisterClip_lambda(int clipId)
// qDebug() << " // /REQUEST TL CLP DELETION: " << clipId << "\n--------\nCLIPS COUNT: " << m_allClips.size();
// Clear effect stack
clearAssetView
(
clipId
);
emit
checkItemDeletion
(
clipId
);
Q_ASSERT
(
m_allClips
.
count
(
clipId
)
>
0
);
Q_ASSERT
(
getClipTrackId
(
clipId
)
==
-
1
);
// clip must be deleted from its track at this point
Q_ASSERT
(
!
m_groups
->
isInGroup
(
clipId
));
// clip must be ungrouped at this point
...
...
src/timeline2/model/timelinemodel.hpp
View file @
b86e9224
...
...
@@ -772,6 +772,8 @@ signals:
void
selectionChanged
();
/* @brief Signal when a track is deleted so we make sure we don't store its id */
void
checkTrackDeletion
(
int
tid
);
/* @brief Emitted when a clip is deleted to check if it was not used in timeline qml */
void
checkItemDeletion
(
int
cid
);
protected:
std
::
unique_ptr
<
Mlt
::
Tractor
>
m_tractor
;
...
...
src/timeline2/model/trackmodel.cpp
View file @
b86e9224
...
...
@@ -250,7 +250,7 @@ bool TrackModel::requestClipInsertion(int clipId, int position, bool updateView,
// A clip move changed the track duration, update track effects
m_effectStack
->
adjustStackLength
(
true
,
0
,
duration
,
0
,
trackDuration
(),
0
,
undo
,
redo
,
true
);
}
auto
reverse
=
requestClipDeletion_lambda
(
clipId
,
updateView
,
finalMove
,
groupMove
,
tru
e
);
auto
reverse
=
requestClipDeletion_lambda
(
clipId
,
updateView
,
finalMove
,
groupMove
,
finalMov
e
);
UPDATE_UNDO_REDO
(
operation
,
reverse
,
local_undo
,
local_redo
);
UPDATE_UNDO_REDO
(
local_redo
,
local_undo
,
undo
,
redo
);
return
true
;
...
...
src/timeline2/view/qml/timeline.qml
View file @
b86e9224
...
...
@@ -885,6 +885,7 @@ Rectangle {
width
:
root
.
width
-
root
.
headerWidth
height
:
root
.
height
x
:
root
.
headerWidth
property
bool
shiftPress
:
false
// This provides continuous scrubbing and scimming at the left/right edges.
hoverEnabled
:
true
acceptedButtons
:
Qt
.
RightButton
|
Qt
.
LeftButton
|
Qt
.
MidButton
...
...
@@ -904,12 +905,13 @@ Rectangle {
}
onPressed
:
{
focus
=
true
if
(
mouse
.
buttons
===
Qt
.
MidButton
||
(
root
.
activeTool
==
0
&&
mouse
.
modifiers
&
Qt
.
ControlModifier
&&
!
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)))
{
shiftPress
=
mouse
.
modifiers
&
Qt
.
ShiftModifier
&&
mouse
.
y
>
ruler
.
height
if
(
mouse
.
buttons
===
Qt
.
MidButton
||
(
root
.
activeTool
==
0
&&
mouse
.
modifiers
&
Qt
.
ControlModifier
&&
!
shiftPress
))
{
clickX
=
mouseX
clickY
=
mouseY
return
}
if
(
root
.
activeTool
===
0
&&
mouse
.
modifiers
&
Qt
.
ShiftModifier
&&
mouse
.
y
>
ruler
.
height
)
{
if
(
root
.
activeTool
===
0
&&
shiftPress
&&
mouse
.
y
>
ruler
.
height
)
{
console
.
log
(
'
1111111111111
\n
REAL SHIFT PRESSED
\n
111111111111
\n
'
)
// rubber selection
rubberSelect
.
x
=
mouse
.
x
+
tracksArea
.
x
...
...
@@ -966,7 +968,7 @@ Rectangle {
scim
=
false
}
onPositionChanged
:
{
if
(
pressed
&&
((
mouse
.
buttons
===
Qt
.
MidButton
)
||
(
mouse
.
buttons
===
Qt
.
LeftButton
&&
root
.
activeTool
==
0
&&
mouse
.
modifiers
&
Qt
.
ControlModifier
&&
!
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
)))
{
if
(
pressed
&&
((
mouse
.
buttons
===
Qt
.
MidButton
)
||
(
mouse
.
buttons
===
Qt
.
LeftButton
&&
root
.
activeTool
==
0
&&
mouse
.
modifiers
&
Qt
.
ControlModifier
&&
!
shiftPress
)))
{
var
newScroll
=
Math
.
min
(
scrollView
.
flickableItem
.
contentX
-
(
mouseX
-
clickX
),
timeline
.
fullDuration
*
root
.
timeScale
-
(
scrollView
.
width
-
scrollView
.
__verticalScrollBar
.
width
))
var
vertScroll
=
Math
.
min
(
scrollView
.
flickableItem
.
contentY
-
(
mouseY
-
clickY
),
trackHeaders
.
height
-
scrollView
.
height
+
scrollView
.
__horizontalScrollBar
.
height
)
scrollView
.
flickableItem
.
contentX
=
Math
.
max
(
newScroll
,
0
)
...
...
@@ -984,7 +986,7 @@ Rectangle {
var
mousePos
=
Math
.
max
(
0
,
Math
.
round
((
mouse
.
x
+
scrollView
.
flickableItem
.
contentX
)
/
timeline
.
scaleFactor
))
root
.
mousePosChanged
(
mousePos
)
ruler
.
showZoneLabels
=
mouse
.
y
<
ruler
.
height
if
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
&&
mouse
.
buttons
===
Qt
.
LeftButton
&&
root
.
activeTool
===
0
&&
!
rubberSelect
.
visible
&&
rubberSelect
.
y
>
0
)
{
if
(
shiftPress
&&
mouse
.
buttons
===
Qt
.
LeftButton
&&
root
.
activeTool
===
0
&&
!
rubberSelect
.
visible
&&
rubberSelect
.
y
>
0
)
{
// rubber selection, check if mouse move was enough
var
dx
=
rubberSelect
.
originX
-
mouseX
var
dy
=
rubberSelect
.
originY
-
mouseY
...
...
@@ -1009,7 +1011,7 @@ Rectangle {
rubberSelect
.
y
=
rubberSelect
.
originY
rubberSelect
.
height
=
newY
-
rubberSelect
.
originY
}
}
else
if
(
mouse
.
buttons
===
Qt
.
LeftButton
&&
!
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
)
{
}
else
if
(
mouse
.
buttons
===
Qt
.
LeftButton
&&
!
shiftPress
)
{
if
(
root
.
activeTool
===
0
||
mouse
.
y
<
ruler
.
height
)
{
proxy
.
position
=
Math
.
max
(
0
,
Math
.
min
((
scrollView
.
flickableItem
.
contentX
+
mouse
.
x
)
/
timeline
.
scaleFactor
,
timeline
.
fullDuration
-
1
))
}
else
if
(
root
.
activeTool
===
2
&&
spacerGroup
>
-
1
)
{
...
...
@@ -1040,19 +1042,20 @@ Rectangle {
timeline
.
selectItems
(
t
,
startFrame
,
endFrame
,
mouse
.
modifiers
&
Qt
.
ControlModifier
);
}
rubberSelect
.
y
=
-
1
}
else
if
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
{
}
else
if
(
shiftPress
)
{
if
(
root
.
activeTool
==
1
)
{
// Shift click, process seek
proxy
.
position
=
Math
.
min
((
scrollView
.
flickableItem
.
contentX
+
mouse
.
x
)
/
timeline
.
scaleFactor
,
timeline
.
fullDuration
-
1
)
}
else
if
(
dragProxy
.
draggedItem
>
-
1
){
}
else
if
(
dragProxy
.
draggedItem
>
-
1
)
{
// Select item
if
(
timeline
.
selection
.
indexOf
(
dragProxy
.
draggedItem
)
==
-
1
)
{
console
.
log
(
'
ADD SELECTION:
'
,
dragProxy
.
draggedItem
)
controller
.
requestAddToSelection
(
dragProxy
.
draggedItem
)
}
else
{
console
.
log
(
'
REMOVE SELECTION:
'
,
dragProxy
.
draggedItem
)
controller
.
requestRemoveFromSelection
(
dragProxy
.
draggedItem
)
}
}
else
if
(
!
rubberSelect
.
visible
)
{
// Mouse release with shift press and no rubber select, seek
proxy
.
position
=
Math
.
min
((
scrollView
.
flickableItem
.
contentX
+
mouse
.
x
)
/
timeline
.
scaleFactor
,
timeline
.
fullDuration
-
1
)
}
return
}
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
b86e9224
...
...
@@ -100,8 +100,8 @@ void TimelineController::setModel(std::shared_ptr<TimelineItemModel> model)
m_zone
=
QPoint
(
-
1
,
-
1
);
m_timelinePreview
=
nullptr
;
m_model
=
std
::
move
(
model
);
connect
(
m_model
.
get
(),
&
TimelineItemModel
::
requestClearAssetView
,
[
&
](
int
id
)
{
pCore
->
clearAssetPanel
(
id
);
connect
(
m_model
.
get
(),
&
TimelineItemModel
::
requestClearAssetView
,
pCore
.
get
(),
&
Core
::
clearAssetPanel
);
connect
(
m_model
.
get
(),
&
TimelineItemModel
::
checkItemDeletion
,
[
this
]
(
int
id
)
{
if
(
m_root
)
{
QMetaObject
::
invokeMethod
(
m_root
,
"checkDeletion"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QVariant
,
id
));
}
...
...
electron Deviser
@edeviser
mentioned in issue
#534 (closed)
·
Jan 21, 2020
mentioned in issue
#534 (closed)
mentioned in issue #534
Toggle commit list
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