Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
61fc54ff
Commit
61fc54ff
authored
Feb 21, 2018
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix drop from clip monitor when no zone selected
Fix crash on subclip drop
parent
064bcf58
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
15 deletions
+20
-15
src/bin/projectitemmodel.cpp
src/bin/projectitemmodel.cpp
+3
-3
src/monitor/monitor.cpp
src/monitor/monitor.cpp
+10
-6
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+6
-6
src/timeline2/view/qml/timeline.qml
src/timeline2/view/qml/timeline.qml
+1
-0
No files found.
src/bin/projectitemmodel.cpp
View file @
61fc54ff
...
...
@@ -174,9 +174,9 @@ bool ProjectItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action
if
(
data
->
hasFormat
(
QStringLiteral
(
"kdenlive/producerslist"
)))
{
// Dropping an Bin item
const
QStringList
ids
=
QString
(
data
->
data
(
QStringLiteral
(
"kdenlive/producerslist"
))).
split
(
QLatin1Char
(
';'
));
if
(
ids
.
constFirst
().
contains
(
QLatin1Char
(
'
#
'
)))
{
if
(
ids
.
constFirst
().
contains
(
QLatin1Char
(
'
/
'
)))
{
// subclip zone
QStringList
clipData
=
ids
.
constFirst
().
split
(
QLatin1Char
(
'
#
'
));
QStringList
clipData
=
ids
.
constFirst
().
split
(
QLatin1Char
(
'
/
'
));
if
(
clipData
.
length
()
>=
3
)
{
QString
id
;
return
requestAddBinSubClip
(
id
,
clipData
.
at
(
1
).
toInt
(),
clipData
.
at
(
2
).
toInt
(),
clipData
.
at
(
0
));
...
...
@@ -275,7 +275,7 @@ QMimeData *ProjectItemModel::mimeData(const QModelIndexList &indices) const
duration
+=
(
std
::
static_pointer_cast
<
ProjectClip
>
(
item
))
->
frameDuration
();
}
else
if
(
type
==
AbstractProjectItem
::
SubClipItem
)
{
QPoint
p
=
item
->
zone
();
list
<<
item
->
clipId
()
+
QLatin1Char
(
'/'
)
+
QString
::
number
(
p
.
x
())
+
QLatin1Char
(
'/'
)
+
QString
::
number
(
p
.
y
());
list
<<
std
::
static_pointer_cast
<
ProjectSubClip
>
(
item
)
->
getMasterClip
()
->
clipId
()
+
QLatin1Char
(
'/'
)
+
QString
::
number
(
p
.
x
())
+
QLatin1Char
(
'/'
)
+
QString
::
number
(
p
.
y
());
}
else
if
(
type
==
AbstractProjectItem
::
FolderItem
)
{
list
<<
"#"
+
item
->
clipId
();
}
...
...
src/monitor/monitor.cpp
View file @
61fc54ff
...
...
@@ -817,13 +817,17 @@ void Monitor::slotStartDrag()
auto
*
drag
=
new
QDrag
(
this
);
auto
*
mimeData
=
new
QMimeData
;
QStringList
list
;
list
.
append
(
m_controller
->
AbstractProjectItem
::
clipId
());
QPoint
p
=
m_glMonitor
->
getControllerProxy
()
->
zone
();
list
.
append
(
QString
::
number
(
p
.
x
()));
list
.
append
(
QString
::
number
(
p
.
y
()));
QByteArray
prodData
;
prodData
.
append
(
list
.
join
(
QLatin1Char
(
'#'
)).
toUtf8
());
QPoint
p
=
m_glMonitor
->
getControllerProxy
()
->
zone
();
if
(
p
.
x
()
==
-
1
||
p
.
y
()
==
-
1
)
{
prodData
=
m_controller
->
AbstractProjectItem
::
clipId
().
toUtf8
();
}
else
{
QStringList
list
;
list
.
append
(
m_controller
->
AbstractProjectItem
::
clipId
());
list
.
append
(
QString
::
number
(
p
.
x
()));
list
.
append
(
QString
::
number
(
p
.
y
()));
prodData
.
append
(
list
.
join
(
QLatin1Char
(
'/'
)).
toUtf8
());
}
mimeData
->
setData
(
QStringLiteral
(
"kdenlive/producerslist"
),
prodData
);
drag
->
setMimeData
(
mimeData
);
/*QPixmap pix = m_currentClip->thumbnail();
...
...
src/timeline2/model/timelinemodel.cpp
View file @
61fc54ff
...
...
@@ -572,8 +572,8 @@ bool TimelineModel::requestClipCreation(const QString &binClipId, int &id, Playl
id
=
clipId
;
Fun
local_undo
=
deregisterClip_lambda
(
clipId
);
QString
bid
=
binClipId
;
if
(
binClipId
.
contains
(
QLatin1Char
(
'
#
'
)))
{
bid
=
binClipId
.
section
(
QLatin1Char
(
'
#
'
),
0
,
0
);
if
(
binClipId
.
contains
(
QLatin1Char
(
'
/
'
)))
{
bid
=
binClipId
.
section
(
QLatin1Char
(
'
/
'
),
0
,
0
);
}
ClipModel
::
construct
(
shared_from_this
(),
bid
,
clipId
,
state
);
auto
clip
=
m_allClips
[
clipId
];
...
...
@@ -585,9 +585,9 @@ bool TimelineModel::requestClipCreation(const QString &binClipId, int &id, Playl
return
true
;
};
if
(
binClipId
.
contains
(
QLatin1Char
(
'
#
'
)))
{
int
in
=
binClipId
.
section
(
QLatin1Char
(
'
#
'
),
1
,
1
).
toInt
();
int
out
=
binClipId
.
section
(
QLatin1Char
(
'
#
'
),
2
,
2
).
toInt
();
if
(
binClipId
.
contains
(
QLatin1Char
(
'
/
'
)))
{
int
in
=
binClipId
.
section
(
QLatin1Char
(
'
/
'
),
1
,
1
).
toInt
();
int
out
=
binClipId
.
section
(
QLatin1Char
(
'
/
'
),
2
,
2
).
toInt
();
int
initLength
=
m_allClips
[
clipId
]
->
getPlaytime
();
bool
res
=
requestItemResize
(
clipId
,
initLength
-
in
,
false
,
true
,
local_undo
,
local_redo
);
res
=
res
&&
requestItemResize
(
clipId
,
out
-
in
+
1
,
true
,
true
,
local_undo
,
local_redo
);
...
...
@@ -608,7 +608,7 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
bool
res
=
false
;
ClipType
type
=
ClipType
::
Unknown
;
if
(
KdenliveSettings
::
splitaudio
())
{
std
::
shared_ptr
<
ProjectClip
>
master
=
pCore
->
projectItemModel
()
->
getClipByBinID
(
binClipId
.
section
(
QLatin1Char
(
'
#
'
),
0
,
0
));
std
::
shared_ptr
<
ProjectClip
>
master
=
pCore
->
projectItemModel
()
->
getClipByBinID
(
binClipId
.
section
(
QLatin1Char
(
'
/
'
),
0
,
0
));
type
=
master
->
clipType
();
}
if
(
type
==
ClipType
::
AV
)
{
...
...
src/timeline2/view/qml/timeline.qml
View file @
61fc54ff
...
...
@@ -225,6 +225,7 @@ Rectangle {
timeline
.
activeTrack
=
tracksRepeater
.
itemAt
(
track
).
trackId
//drag.acceptProposedAction()
clipBeingDroppedData
=
drag
.
getDataAsString
(
'
kdenlive/producerslist
'
)
console
.
log
(
'
dropped data:
'
,
clipBeingDroppedData
)
clipBeingDroppedId
=
timeline
.
insertClip
(
timeline
.
activeTrack
,
frame
,
clipBeingDroppedData
,
false
,
true
)
continuousScrolling
(
drag
.
x
+
scrollView
.
flickableItem
.
contentX
)
}
else
{
...
...
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