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
5c87fa84
Commit
5c87fa84
authored
Jan 06, 2022
by
Julius Künzel
Browse files
FIx after
7ef5187f
parent
39ba3e48
Changes
2
Show whitespace changes
Inline
Side-by-side
src/titler/titlewidget.cpp
View file @
5c87fa84
...
...
@@ -56,6 +56,8 @@
#include <mlt++/MltProfile.h>
#include <utility>
static
QList
<
TitleTemplate
>
titleTemplates
;
// TODO What exactly is this variable good for?
int
settingUp
=
0
;
...
...
@@ -75,7 +77,7 @@ void TitleWidget::refreshTemplateBoxContents()
{
templateBox
->
clear
();
templateBox
->
addItem
(
QString
());
for
(
const
TitleTemplate
&
t
:
qAsConst
(
m_
titleTemplates
))
{
for
(
const
TitleTemplate
&
t
:
qAsConst
(
titleTemplates
))
{
templateBox
->
addItem
(
t
.
icon
,
t
.
name
,
t
.
file
);
}
}
...
...
@@ -655,7 +657,7 @@ QStringList TitleWidget::extractFontList(const QString &xml)
void
TitleWidget
::
refreshTitleTemplates
(
const
QString
&
projectPath
)
{
QStringList
filters
=
QStringList
()
<<
QStringLiteral
(
"*.kdenlivetitle"
);
m_
titleTemplates
.
clear
();
titleTemplates
.
clear
();
// project templates
QDir
dir
(
projectPath
);
...
...
@@ -665,13 +667,13 @@ void TitleWidget::refreshTitleTemplates(const QString &projectPath)
t
.
name
=
fname
;
t
.
file
=
dir
.
absoluteFilePath
(
fname
);
t
.
icon
=
QIcon
(
KThumb
::
getImage
(
QUrl
::
fromLocalFile
(
t
.
file
),
0
,
60
,
-
1
));
m_
titleTemplates
.
append
(
t
);
titleTemplates
.
append
(
t
);
}
// system templates
QStringList
t
itleTemplates
=
QStandardPaths
::
locateAll
(
QStandardPaths
::
AppLocalDataLocation
,
QStringLiteral
(
"titles/"
),
QStandardPaths
::
LocateDirectory
);
t
itleTemplates
.
removeDuplicates
();
for
(
const
QString
&
folderpath
:
qAsConst
(
t
itleTemplates
))
{
QStringList
currentT
itleTemplates
=
QStandardPaths
::
locateAll
(
QStandardPaths
::
AppLocalDataLocation
,
QStringLiteral
(
"titles/"
),
QStandardPaths
::
LocateDirectory
);
currentT
itleTemplates
.
removeDuplicates
();
for
(
const
QString
&
folderpath
:
qAsConst
(
currentT
itleTemplates
))
{
QDir
folder
(
folderpath
);
QStringList
filesnames
=
folder
.
entryList
(
filters
,
QDir
::
Files
);
for
(
const
QString
&
fname
:
qAsConst
(
filesnames
))
{
...
...
@@ -679,7 +681,7 @@ void TitleWidget::refreshTitleTemplates(const QString &projectPath)
t
.
name
=
fname
;
t
.
file
=
folder
.
absoluteFilePath
(
fname
);
t
.
icon
=
QIcon
(
KThumb
::
getImage
(
QUrl
::
fromLocalFile
(
t
.
file
),
0
,
60
,
-
1
));
m_
titleTemplates
.
append
(
t
);
titleTemplates
.
append
(
t
);
}
}
}
...
...
src/titler/titlewidget.h
View file @
5c87fa84
...
...
@@ -86,7 +86,7 @@ public:
int
duration
()
const
;
/** @brief Retrieves a list of all available title templates. */
void
refreshTitleTemplates
(
const
QString
&
projectPath
);
static
void
refreshTitleTemplates
(
const
QString
&
projectPath
);
/** @brief Returns a title name suggestion based on content */
const
QString
titleSuggest
();
...
...
@@ -154,7 +154,7 @@ private:
PatternsModel
*
m_patternsModel
;
QList
<
TitleTemplate
>
m_titleTemplates
;
//
QList<TitleTemplate> m_titleTemplates;
enum
ValueType
{
ValueWidth
=
1
,
ValueHeight
=
2
,
ValueX
=
4
,
ValueY
=
8
};
...
...
Write
Preview
Supports
Markdown
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