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
eba9129f
Commit
eba9129f
authored
Jun 14, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When opening project with missing proxies, allow not rebuilding proxies
parent
78f53637
Pipeline
#23501
passed with stage
in 26 minutes and 48 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
93 additions
and
46 deletions
+93
-46
src/bin/bin.cpp
src/bin/bin.cpp
+19
-1
src/bin/bin.h
src/bin/bin.h
+2
-0
src/doc/documentchecker.cpp
src/doc/documentchecker.cpp
+16
-1
src/timeline2/model/builders/meltBuilder.cpp
src/timeline2/model/builders/meltBuilder.cpp
+1
-0
src/timeline2/model/clipmodel.cpp
src/timeline2/model/clipmodel.cpp
+6
-0
src/timeline2/model/clipmodel.hpp
src/timeline2/model/clipmodel.hpp
+3
-0
src/timeline2/model/timelineitemmodel.cpp
src/timeline2/model/timelineitemmodel.cpp
+1
-2
src/ui/missingclips_ui.ui
src/ui/missingclips_ui.ui
+45
-42
No files found.
src/bin/bin.cpp
View file @
eba9129f
...
...
@@ -1755,7 +1755,7 @@ void Bin::slotAddFolder()
// Edit folder name
auto
folder
=
m_itemModel
->
getFolderByBinId
(
newId
);
auto
ix
=
m_itemModel
->
getIndexFromItem
(
folder
);
// Scroll to ensure folder is visible
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
PositionAtCenter
);
qDebug
()
<<
"selecting"
<<
ix
;
...
...
@@ -4171,3 +4171,21 @@ void Bin::addClipMarker(const QString binId, QList<int> positions)
}
clip
->
getMarkerModel
()
->
addMarkers
(
markers
,
KdenliveSettings
::
default_marker_type
());
}
void
Bin
::
checkMissingProxies
()
{
if
(
m_itemModel
->
getRootFolder
()
==
nullptr
||
m_itemModel
->
getRootFolder
()
->
childCount
()
==
0
)
{
return
;
}
QList
<
std
::
shared_ptr
<
ProjectClip
>>
clipList
=
m_itemModel
->
getRootFolder
()
->
childClips
();
QList
<
std
::
shared_ptr
<
ProjectClip
>>
toProxy
;
for
(
auto
clip
:
clipList
)
{
if
(
clip
->
getProducerIntProperty
(
QStringLiteral
(
"_replaceproxy"
))
>
0
)
{
clip
->
resetProducerProperty
(
QStringLiteral
(
"_replaceproxy"
));
toProxy
<<
clip
;
}
}
if
(
!
toProxy
.
isEmpty
())
{
pCore
->
currentDoc
()
->
slotProxyCurrentItem
(
true
,
toProxy
);
}
}
src/bin/bin.h
View file @
eba9129f
...
...
@@ -283,6 +283,8 @@ public:
void
saveZone
(
const
QStringList
&
info
,
const
QDir
&
dir
);
/** @brief A bin clip changed (its effects), invalidate preview */
void
invalidateClip
(
const
QString
&
binId
);
/** @brief Recreate missing proxies on document opening */
void
checkMissingProxies
();
// TODO refac: remove this and call directly the function in ProjectItemModel
void
cleanup
();
...
...
src/doc/documentchecker.cpp
View file @
eba9129f
...
...
@@ -37,6 +37,7 @@
#include <QStandardPaths>
#include <QTreeWidgetItem>
#include <utility>
const
int
hashRole
=
Qt
::
UserRole
;
const
int
sizeRole
=
Qt
::
UserRole
+
1
;
const
int
idRole
=
Qt
::
UserRole
+
2
;
...
...
@@ -541,7 +542,19 @@ bool DocumentChecker::hasErrorInClips()
if
(
!
infoLabel
.
isEmpty
())
{
infoLabel
.
append
(
QStringLiteral
(
"
\n
"
));
}
infoLabel
.
append
(
i18n
(
"Missing proxies will be recreated after opening."
));
infoLabel
.
append
(
i18n
(
"Missing proxies can be recreated on opening."
));
m_ui
.
rebuildProxies
->
setChecked
(
true
);
connect
(
m_ui
.
rebuildProxies
,
&
QCheckBox
::
stateChanged
,
[
missingProxies
]
(
int
state
)
{
for
(
QDomElement
e
:
missingProxies
)
{
if
(
state
==
Qt
::
Checked
)
{
e
.
setAttribute
(
QStringLiteral
(
"_replaceproxy"
),
QStringLiteral
(
"1"
));
}
else
{
e
.
removeAttribute
(
QStringLiteral
(
"_replaceproxy"
));
}
}
});
}
else
{
m_ui
.
rebuildProxies
->
setVisible
(
false
);
}
if
(
!
missingSources
.
isEmpty
())
{
if
(
!
infoLabel
.
isEmpty
())
{
...
...
@@ -579,6 +592,8 @@ bool DocumentChecker::hasErrorInClips()
m_missingProxyIds
<<
id
;
// Tell Kdenlive to recreate proxy
e
.
setAttribute
(
QStringLiteral
(
"_replaceproxy"
),
QStringLiteral
(
"1"
));
// Remove reference to missing proxy
Xml
::
setXmlProperty
(
e
,
QStringLiteral
(
"kdenlive:proxy"
),
QStringLiteral
(
"-"
));
// Replace proxy url with real clip in MLT producers
QDomElement
mltProd
;
int
prodsCount
=
documentProducers
.
count
();
...
...
src/timeline2/model/builders/meltBuilder.cpp
View file @
eba9129f
...
...
@@ -58,6 +58,7 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
m_errorMessage
.
clear
();
std
::
unordered_map
<
QString
,
QString
>
binIdCorresp
;
pCore
->
projectItemModel
()
->
loadBinPlaylist
(
&
tractor
,
timeline
->
tractor
(),
binIdCorresp
,
progressDialog
);
pCore
->
bin
()
->
checkMissingProxies
();
QSet
<
QString
>
reserved_names
{
QLatin1String
(
"playlistmain"
),
QLatin1String
(
"timeline_preview"
),
QLatin1String
(
"timeline_overlay"
),
QLatin1String
(
"black_track"
)};
...
...
src/timeline2/model/clipmodel.cpp
View file @
eba9129f
...
...
@@ -914,3 +914,9 @@ const QString ClipModel::clipName()
{
return
pCore
->
projectItemModel
()
->
getClipByBinID
(
m_binClipId
)
->
clipName
();
}
bool
ClipModel
::
isProxied
()
const
{
std
::
shared_ptr
<
ProjectClip
>
binClip
=
pCore
->
projectItemModel
()
->
getClipByBinID
(
m_binClipId
);
return
binClip
->
hasProxy
();
}
src/timeline2/model/clipmodel.hpp
View file @
eba9129f
...
...
@@ -211,6 +211,9 @@ protected:
/** @brief Returns the producer's duration, or -1 if it can be resized without limit */
int
getMaxDuration
()
const
;
/** @brief Returns true if the parent Bin Clip uses a proxy */
bool
isProxied
()
const
;
/*@brief This is a debug function to ensure the clip is in a valid state */
bool
checkConsistency
();
...
...
src/timeline2/model/timelineitemmodel.cpp
View file @
eba9129f
...
...
@@ -273,8 +273,7 @@ QVariant TimelineItemModel::data(const QModelIndex &index, int role) const
return
result
;
}
case
IsProxyRole
:
{
const
QString
proxy
=
clip
->
getProperty
(
"kdenlive:proxy"
);
return
proxy
.
size
()
>
2
;
return
clip
->
isProxied
();
}
case
FakeTrackIdRole
:
return
clip
->
getFakeTrackId
();
...
...
src/ui/missingclips_ui.ui
View file @
eba9129f
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
120
1
</width>
<width>
98
1
</width>
<height>
269
</height>
</rect>
</property>
...
...
@@ -14,21 +14,47 @@
<string>
Clip Problems
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"recursiveSearch"
>
<property
name=
"text"
>
<string>
Search recursively
</string>
<item
row=
"3"
column=
"5"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"1"
column=
"0"
colspan=
"7"
>
<widget
class=
"KMessageWidget"
name=
"infoLabel"
>
<property
name=
"wordWrap"
stdset=
"0"
>
<bool>
true
</bool>
</property>
<property
name=
"closeButtonVisible"
stdset=
"0"
>
<bool>
false
</bool>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<item
row=
"3"
column=
"6"
>
<widget
class=
"QDialogButtonBox"
name=
"buttonBox"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Abort|QDialogButtonBox::Ok
</set>
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"usePlaceholders"
>
<property
name=
"text"
>
<string>
Use placeholders for missing clips
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
colspan=
"
5
"
>
<item
row=
"0"
column=
"0"
colspan=
"
7
"
>
<widget
class=
"QTreeWidget"
name=
"treeWidget"
>
<property
name=
"alternatingRowColors"
>
<bool>
true
</bool>
...
...
@@ -57,46 +83,24 @@
</column>
</widget>
</item>
<item
row=
"2"
column=
"4"
>
<widget
class=
"QDialogButtonBox"
name=
"buttonBox"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Abort|QDialogButtonBox::Ok
</set>
<item
row=
"3"
column=
"2"
>
<widget
class=
"QPushButton"
name=
"removeSelected"
>
<property
name=
"text"
>
<string>
Remove selected clips
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"3"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"1"
column=
"0"
colspan=
"5"
>
<widget
class=
"KMessageWidget"
name=
"infoLabel"
>
<property
name=
"wordWrap"
>
<bool>
true
</bool>
</property>
<property
name=
"closeButtonVisible"
>
<bool>
false
</bool>
</property>
<property
name=
"messageType"
>
<enum>
KMessageWidget::Warning
</enum>
<item
row=
"3"
column=
"3"
>
<widget
class=
"QCheckBox"
name=
"rebuildProxies"
>
<property
name=
"text"
>
<string>
Rebuild Proxies
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"
2
"
>
<widget
class=
"QPushButton"
name=
"re
moveSelected
"
>
<item
row=
"2"
column=
"
1
"
>
<widget
class=
"QPushButton"
name=
"re
cursiveSearch
"
>
<property
name=
"text"
>
<string>
Remove selected clips
</string>
<string>
Search recursively
</string>
</property>
</widget>
</item>
...
...
@@ -107,12 +111,11 @@
<class>
KMessageWidget
</class>
<extends>
QFrame
</extends>
<header>
kmessagewidget.h
</header>
<container>
1
</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>
recursiveSearch
</tabstop>
<tabstop>
usePlaceholders
</tabstop>
<tabstop>
removeSelected
</tabstop>
<tabstop>
treeWidget
</tabstop>
</tabstops>
<resources/>
...
...
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