Skip to content
GitLab
Menu
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
fdfb1e51
Commit
fdfb1e51
authored
Oct 18, 2019
by
Jean-Baptiste Mardelle
Browse files
Fix red track background on add track
parent
b4786590
Pipeline
#9118
passed with stage
in 15 minutes and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
fdfb1e51
...
...
@@ -2127,9 +2127,6 @@ bool TimelineModel::requestTrackInsertion(int position, int &id, const QString &
id
=
trackId
;
Fun
local_undo
=
deregisterTrack_lambda
(
trackId
,
true
);
TrackModel
::
construct
(
shared_from_this
(),
trackId
,
position
,
trackName
,
audioTrack
);
if
(
updateView
)
{
_resetView
();
}
auto
track
=
getTrackById
(
trackId
);
Fun
local_redo
=
[
track
,
position
,
updateView
,
this
]()
{
// We capture a shared_ptr to the track, which means that as long as this undo object lives, the track object is not deleted. To insert it back it is
...
...
@@ -2141,6 +2138,9 @@ bool TimelineModel::requestTrackInsertion(int position, int &id, const QString &
return
true
;
};
UPDATE_UNDO_REDO
(
local_redo
,
local_undo
,
undo
,
redo
);
if
(
updateView
)
{
_resetView
();
}
return
true
;
}
...
...
@@ -2234,6 +2234,8 @@ void TimelineModel::registerTrack(std::shared_ptr<TrackModel> track, int pos, bo
// it now contains the iterator to the inserted element, we store it
Q_ASSERT
(
m_iteratorTable
.
count
(
id
)
==
0
);
// check that id is not used (shouldn't happen)
m_iteratorTable
[
id
]
=
it
;
beginInsertRows
(
QModelIndex
(),
pos
,
pos
);
endInsertRows
();
int
cache
=
(
int
)
QThread
::
idealThreadCount
()
+
((
int
)
m_allTracks
.
size
()
+
1
)
*
2
;
mlt_service_cache_set_size
(
NULL
,
"producer_avformat"
,
qMax
(
4
,
cache
));
}
...
...
@@ -2265,6 +2267,8 @@ Fun TimelineModel::deregisterTrack_lambda(int id, bool updateView)
// send update to the model
m_allTracks
.
erase
(
it
);
// actual deletion of object
m_iteratorTable
.
erase
(
id
);
// clean table
beginRemoveRows
(
QModelIndex
(),
index
,
index
);
endInsertRows
();
if
(
updateView
)
{
_resetView
();
}
...
...
Write
Preview
Supports
Markdown
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