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
a845c058
Commit
a845c058
authored
Apr 17, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
c8bfab7b
Pipeline
#18522
passed with stage
in 9 minutes and 15 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
8 deletions
+17
-8
src/core.cpp
src/core.cpp
+3
-0
src/timeline2/model/timelinefunctions.cpp
src/timeline2/model/timelinefunctions.cpp
+12
-6
src/timeline2/model/timelinefunctions.hpp
src/timeline2/model/timelinefunctions.hpp
+1
-0
tests/regressions.cpp
tests/regressions.cpp
+1
-1
tests/trimmingtest.cpp
tests/trimmingtest.cpp
+0
-1
No files found.
src/core.cpp
View file @
a845c058
...
...
@@ -906,6 +906,9 @@ std::unique_ptr<Mlt::Producer> Core::getTrackProducerInstance(int tid)
bool
Core
::
enableMultiTrack
(
bool
enable
)
{
if
(
!
m_guiConstructed
||
!
m_mainWindow
->
getCurrentTimeline
())
{
return
false
;
}
bool
isMultiTrack
=
pCore
->
monitorManager
()
->
isMultiTrack
();
if
(
isMultiTrack
||
enable
)
{
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
slotMultitrackView
(
enable
,
enable
);
...
...
src/timeline2/model/timelinefunctions.cpp
View file @
a845c058
...
...
@@ -1567,23 +1567,27 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
}
}
if
(
!
clipsImported
)
{
QTimer
::
singleShot
(
200
,
timeline
.
get
(),
[
timeline
,
copiedItems
,
position
]()
{
TimelineFunctions
::
pasteTimelineClips
(
timeline
,
copiedItems
,
position
);
});
// Clips from same document, directly proceed to pasting
return
TimelineFunctions
::
pasteTimelineClips
(
timeline
,
copiedItems
,
position
,
undo
,
redo
,
false
);
}
qDebug
()
<<
"++++++++++++
\n
WAITIND FOR BIN INSERTION: "
<<
waitingBinIds
<<
"
\n\n
+++++++++++++"
;
return
true
;
}
bool
TimelineFunctions
::
pasteTimelineClips
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
QDomDocument
copiedItems
,
int
position
)
{
std
::
function
<
bool
(
void
)
>
timeline_undo
=
[]()
{
return
true
;
};
std
::
function
<
bool
(
void
)
>
timeline_redo
=
[]()
{
return
true
;
};
return
TimelineFunctions
::
pasteTimelineClips
(
timeline
,
copiedItems
,
position
,
timeline_undo
,
timeline_redo
,
true
);
}
bool
TimelineFunctions
::
pasteTimelineClips
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
QDomDocument
copiedItems
,
int
position
,
Fun
&
timeline_undo
,
Fun
&
timeline_redo
,
bool
pushToStack
)
{
// Wait until all bin clips are inserted
QDomNodeList
clips
=
copiedItems
.
documentElement
().
elementsByTagName
(
QStringLiteral
(
"clip"
));
QDomNodeList
compositions
=
copiedItems
.
documentElement
().
elementsByTagName
(
QStringLiteral
(
"composition"
));
int
offset
=
copiedItems
.
documentElement
().
attribute
(
QStringLiteral
(
"offset"
)).
toInt
();
std
::
function
<
bool
(
void
)
>
timeline_undo
=
[]()
{
return
true
;
};
std
::
function
<
bool
(
void
)
>
timeline_redo
=
[]()
{
return
true
;
};
bool
res
=
true
;
QLocale
locale
;
std
::
unordered_map
<
int
,
int
>
correspondingIds
;
...
...
@@ -1684,7 +1688,9 @@ bool TimelineFunctions::pasteTimelineClips(const std::shared_ptr<TimelineItemMod
PUSH_FRONT_LAMBDA
(
unselect
,
timeline_undo
);
PUSH_FRONT_LAMBDA
(
unselect
,
timeline_redo
);
//UPDATE_UNDO_REDO_NOLOCK(timeline_redo, timeline_undo, undo, redo);
pCore
->
pushUndo
(
timeline_undo
,
timeline_redo
,
i18n
(
"Paste timeline clips"
));
if
(
pushToStack
)
{
pCore
->
pushUndo
(
timeline_undo
,
timeline_redo
,
i18n
(
"Paste timeline clips"
));
}
semaphore
.
release
(
1
);
return
true
;
}
...
...
src/timeline2/model/timelinefunctions.hpp
View file @
a845c058
...
...
@@ -63,6 +63,7 @@ struct TimelineFunctions
static
bool
pasteClips
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
const
QString
&
pasteString
,
int
trackId
,
int
position
);
static
bool
pasteClips
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
const
QString
&
pasteString
,
int
trackId
,
int
position
,
Fun
&
undo
,
Fun
&
redo
);
static
bool
pasteTimelineClips
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
QDomDocument
copiedItems
,
int
position
);
static
bool
pasteTimelineClips
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
QDomDocument
copiedItems
,
int
position
,
Fun
&
timeline_undo
,
Fun
&
timeline_redo
,
bool
pushToStack
);
/* @brief Request the addition of multiple clips to the timeline
* If the addition of any of the clips fails, the entire operation is undone.
...
...
tests/regressions.cpp
View file @
a845c058
...
...
@@ -873,7 +873,7 @@ TEST_CASE("FuzzBug5")
REQUIRE
(
timeline_0
->
checkConsistency
());
REQUIRE
(
timeline_1
->
checkConsistency
());
{
bool
res
=
timeline_1
->
requestGroupMove
(
10
,
9
,
0
,
0
,
false
,
false
);
bool
res
=
timeline_1
->
requestGroupMove
(
10
,
9
,
0
,
0
,
true
,
false
,
false
);
REQUIRE
(
res
==
false
);
}
REQUIRE
(
timeline_0
->
checkConsistency
());
...
...
tests/trimmingtest.cpp
View file @
a845c058
...
...
@@ -1052,7 +1052,6 @@ TEST_CASE("Copy/paste", "[CP]")
cid4
=
timeline
->
m_groups
->
getSplitPartner
(
cid3
);
state2
(
tid2b
);
}
binModel
->
clean
();
pCore
->
m_projectManager
=
nullptr
;
Logger
::
print_trace
();
...
...
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