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
4b689537
Commit
4b689537
authored
Dec 07, 2021
by
Jean-Baptiste Mardelle
Browse files
Ensure lut effect is initialized with a file when added
Related to
#1263
parent
a0663d90
Pipeline
#106541
passed with stage
in 9 minutes and 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/assets/model/assetparametermodel.cpp
View file @
4b689537
...
...
@@ -14,6 +14,8 @@
#include <QJsonArray>
#include <QJsonObject>
#include <QString>
#include <QDir>
#include <QDirIterator>
#include <QRegularExpression>
#include <effects/effectsrepository.hpp>
#define DEBUG_LOCALE false
...
...
@@ -184,6 +186,30 @@ AssetParameterModel::AssetParameterModel(std::unique_ptr<Mlt::Properties> asset,
qDebug
()
<<
"No fixing needed for"
<<
name
<<
"="
<<
value
;
}
}
if
(
currentRow
.
type
==
ParamType
::
UrlList
)
{
QString
values
=
currentParameter
.
attribute
(
QStringLiteral
(
"paramlist"
));
if
(
values
==
QLatin1String
(
"%lutPaths"
))
{
QString
filter
=
currentParameter
.
attribute
(
QStringLiteral
(
"filter"
));;
filter
.
remove
(
0
,
filter
.
indexOf
(
"("
)
+
1
);
filter
.
remove
(
filter
.
indexOf
(
")"
)
-
1
,
-
1
);
QStringList
fileExt
=
filter
.
split
(
" "
);
// check for Kdenlive installed luts files
QStringList
customLuts
=
QStandardPaths
::
locateAll
(
QStandardPaths
::
AppLocalDataLocation
,
QStringLiteral
(
"luts"
),
QStandardPaths
::
LocateDirectory
);
QStringList
results
;
for
(
const
QString
&
folderpath
:
qAsConst
(
customLuts
))
{
QDir
dir
(
folderpath
);
QDirIterator
it
(
dir
.
absolutePath
(),
fileExt
,
QDir
::
Files
,
QDirIterator
::
Subdirectories
);
while
(
it
.
hasNext
())
{
results
.
append
(
it
.
next
());
break
;
}
}
if
(
!
results
.
isEmpty
())
{
value
=
results
.
first
();
}
}
}
if
(
!
isFixed
)
{
currentRow
.
value
=
value
;
QString
title
=
i18n
(
currentParameter
.
firstChildElement
(
QStringLiteral
(
"name"
)).
text
().
toUtf8
().
data
());
...
...
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