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
031ab015
Commit
031ab015
authored
Jul 13, 2020
by
Jean-Baptiste Mardelle
Browse files
cleanup qml, fix red track on insert
parent
09a70bb1
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelineitemmodel.cpp
View file @
031ab015
...
...
@@ -95,7 +95,7 @@ QModelIndex TimelineItemModel::index(int row, int column, const QModelIndex &par
// Invalid index requested
Q_ASSERT
(
false
);
}
}
else
if
(
row
<
get
Tracks
Count
()
&&
row
>=
0
)
{
}
else
if
(
row
<
(
int
)
m_all
Tracks
.
size
()
&&
row
>=
0
)
{
// Get sort order
// row = getTracksCount() - 1 - row;
auto
it
=
m_allTracks
.
cbegin
();
...
...
@@ -176,7 +176,7 @@ int TimelineItemModel::rowCount(const QModelIndex &parent) const
}
return
getTrackClipsCount
(
id
)
+
getTrackCompositionsCount
(
id
);
}
return
get
Tracks
Count
();
return
(
int
)
m_all
Tracks
.
size
();
}
int
TimelineItemModel
::
columnCount
(
const
QModelIndex
&
parent
)
const
...
...
src/timeline2/model/timelinemodel.cpp
View file @
031ab015
...
...
@@ -2474,7 +2474,7 @@ bool TimelineModel::requestTrackInsertion(int position, int &id, const QString &
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
TrackTagRole
});
}
}
else
{
for
(
int
i
=
position
;
i
<
get
Tracks
Count
();
i
++
)
{
for
(
int
i
=
position
;
i
<
(
int
)
m_all
Tracks
.
size
();
i
++
)
{
QModelIndex
ix
=
makeTrackIndexFromID
(
getTrackIndexFromPosition
(
i
));
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
TrackTagRole
});
}
...
...
@@ -2658,11 +2658,11 @@ void TimelineModel::registerTrack(std::shared_ptr<TrackModel> track, int pos, bo
// we now insert in the list
auto
posIt
=
m_allTracks
.
begin
();
std
::
advance
(
posIt
,
pos
);
beginInsertRows
(
QModelIndex
(),
pos
,
pos
);
auto
it
=
m_allTracks
.
insert
(
posIt
,
std
::
move
(
track
));
// 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
));
...
...
src/timeline2/view/qml/timeline.qml
View file @
031ab015
...
...
@@ -1032,7 +1032,7 @@ Rectangle {
border.width
:
1
border.color
:
root
.
frameColor
height
:
model
.
trackHeight
color
:
tracksRepeater
.
itemAt
(
index
)
?
((
tracksRepeater
.
itemAt
(
index
).
trackInternalId
==
=
timeline
.
activeTrack
)
?
Qt
.
tint
(
getTrackColor
(
tracksRepeater
.
itemAt
(
index
).
isA
udio
,
false
),
selectedTrackColor
)
:
getTrackColor
(
tracksRepeater
.
itemAt
(
index
).
isA
udio
,
false
)
)
:
'
red
'
color
:
(
model
.
item
==
timeline
.
activeTrack
)
?
Qt
.
tint
(
getTrackColor
(
model
.
a
udio
,
false
),
selectedTrackColor
)
:
getTrackColor
(
model
.
a
udio
,
false
)
}
}
}
...
...
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