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
10a263fd
Commit
10a263fd
authored
Mar 28, 2019
by
Nicolas Carion
Browse files
Don't invalidate preview on objects not inserted yet. Closes
#64
parent
8918134c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
10a263fd
...
...
@@ -202,7 +202,7 @@ int TimelineModel::getCompositionTrackId(int compoId) const
int
TimelineModel
::
getItemTrackId
(
int
itemId
)
const
{
READ_LOCK
();
Q_ASSERT
(
is
Clip
(
itemId
)
||
isComposition
(
itemId
));
Q_ASSERT
(
is
Item
(
itemId
));
if
(
isComposition
(
itemId
))
{
return
getCompositionTrackId
(
itemId
);
}
...
...
@@ -1087,7 +1087,7 @@ bool TimelineModel::requestItemDeletion(int itemId, bool logUndo)
{
QWriteLocker
locker
(
&
m_lock
);
TRACE
(
itemId
,
logUndo
);
Q_ASSERT
(
is
Clip
(
itemId
)
||
isComposition
(
itemId
));
Q_ASSERT
(
is
Item
(
itemId
));
QString
actionLabel
;
if
(
m_groups
->
isInGroup
(
itemId
))
{
actionLabel
=
i18n
(
"Remove group"
);
...
...
@@ -1315,7 +1315,7 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
{
QWriteLocker
locker
(
&
m_lock
);
Q_ASSERT
(
m_allGroups
.
count
(
groupId
)
>
0
);
Q_ASSERT
(
is
Clip
(
itemId
)
||
isComposition
(
itemId
));
Q_ASSERT
(
is
Item
(
itemId
));
if
(
getGroupElements
(
groupId
).
count
(
itemId
)
==
0
)
{
// this group doesn't contain the clip, abort
return
false
;
...
...
@@ -1522,7 +1522,7 @@ int TimelineModel::requestItemResize(int itemId, int size, bool right, bool logU
}
QWriteLocker
locker
(
&
m_lock
);
TRACE
(
itemId
,
size
,
right
,
logUndo
,
snapDistance
,
allowSingleResize
);
Q_ASSERT
(
is
Clip
(
itemId
)
||
isComposition
(
itemId
));
Q_ASSERT
(
is
Item
(
itemId
));
if
(
size
<=
0
)
{
TRACE_RES
(
-
1
);
return
-
1
;
...
...
@@ -1624,7 +1624,7 @@ 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
(
is
Clip
(
itemId
)
||
isComposition
(
itemId
));
Q_ASSERT
(
is
Item
(
itemId
));
if
(
getItemTrackId
(
itemId
)
!=
-
1
)
{
qDebug
()
<<
"++++++++++
\n
RESIZING ITEM: "
<<
itemId
<<
"
\n
+++++++"
;
QModelIndex
modelIndex
=
isClip
(
itemId
)
?
makeClipIndexFromID
(
itemId
)
:
makeCompositionIndexFromID
(
itemId
);
...
...
@@ -2038,6 +2038,11 @@ bool TimelineModel::isComposition(int id) const
return
m_allCompositions
.
count
(
id
)
>
0
;
}
bool
TimelineModel
::
isItem
(
int
id
)
const
{
return
isClip
(
id
)
||
isComposition
(
id
);
}
bool
TimelineModel
::
isTrack
(
int
id
)
const
{
return
m_iteratorTable
.
count
(
id
)
>
0
;
...
...
src/timeline2/model/timelinemodel.hpp
View file @
10a263fd
...
...
@@ -220,6 +220,9 @@ public:
/* @brief Helper function that returns true if the given ID corresponds to a composition */
Q_INVOKABLE
bool
isComposition
(
int
id
)
const
;
/* @brief Helper function that returns true if the given ID corresponds to a timeline item (composition or clip) */
Q_INVOKABLE
bool
isItem
(
int
id
)
const
;
/* @brief Helper function that returns true if the given ID corresponds to a track */
Q_INVOKABLE
bool
isTrack
(
int
id
)
const
;
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
10a263fd
...
...
@@ -1249,7 +1249,7 @@ void TimelineController::removeSpace(int trackId, int frame, bool affectAllTrack
void
TimelineController
::
invalidateItem
(
int
cid
)
{
if
(
!
m_timelinePreview
||
m_model
->
getItemTrackId
(
cid
)
==
-
1
)
{
if
(
!
m_timelinePreview
||
!
m_model
->
isItem
(
cid
)
||
m_model
->
getItemTrackId
(
cid
)
==
-
1
)
{
return
;
}
int
start
=
m_model
->
getItemPosition
(
cid
);
...
...
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