Commit 5c87fa84 authored by Julius Künzel's avatar Julius Künzel
Browse files

FIx after 7ef5187f

parent 39ba3e48
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
#include <mlt++/MltProfile.h> #include <mlt++/MltProfile.h>
#include <utility> #include <utility>
static QList<TitleTemplate> titleTemplates;
// TODO What exactly is this variable good for? // TODO What exactly is this variable good for?
int settingUp = 0; int settingUp = 0;
...@@ -75,7 +77,7 @@ void TitleWidget::refreshTemplateBoxContents() ...@@ -75,7 +77,7 @@ void TitleWidget::refreshTemplateBoxContents()
{ {
templateBox->clear(); templateBox->clear();
templateBox->addItem(QString()); templateBox->addItem(QString());
for (const TitleTemplate &t : qAsConst(m_titleTemplates)) { for (const TitleTemplate &t : qAsConst(titleTemplates)) {
templateBox->addItem(t.icon, t.name, t.file); templateBox->addItem(t.icon, t.name, t.file);
} }
} }
...@@ -655,7 +657,7 @@ QStringList TitleWidget::extractFontList(const QString &xml) ...@@ -655,7 +657,7 @@ QStringList TitleWidget::extractFontList(const QString &xml)
void TitleWidget::refreshTitleTemplates(const QString &projectPath) void TitleWidget::refreshTitleTemplates(const QString &projectPath)
{ {
QStringList filters = QStringList() << QStringLiteral("*.kdenlivetitle"); QStringList filters = QStringList() << QStringLiteral("*.kdenlivetitle");
m_titleTemplates.clear(); titleTemplates.clear();
// project templates // project templates
QDir dir(projectPath); QDir dir(projectPath);
...@@ -665,13 +667,13 @@ void TitleWidget::refreshTitleTemplates(const QString &projectPath) ...@@ -665,13 +667,13 @@ void TitleWidget::refreshTitleTemplates(const QString &projectPath)
t.name = fname; t.name = fname;
t.file = dir.absoluteFilePath(fname); t.file = dir.absoluteFilePath(fname);
t.icon = QIcon(KThumb::getImage(QUrl::fromLocalFile(t.file), 0, 60, -1)); t.icon = QIcon(KThumb::getImage(QUrl::fromLocalFile(t.file), 0, 60, -1));
m_titleTemplates.append(t); titleTemplates.append(t);
} }
// system templates // system templates
QStringList titleTemplates = QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory); QStringList currentTitleTemplates = QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory);
titleTemplates.removeDuplicates(); currentTitleTemplates.removeDuplicates();
for (const QString &folderpath : qAsConst(titleTemplates)) { for (const QString &folderpath : qAsConst(currentTitleTemplates)) {
QDir folder(folderpath); QDir folder(folderpath);
QStringList filesnames = folder.entryList(filters, QDir::Files); QStringList filesnames = folder.entryList(filters, QDir::Files);
for (const QString &fname : qAsConst(filesnames)) { for (const QString &fname : qAsConst(filesnames)) {
...@@ -679,7 +681,7 @@ void TitleWidget::refreshTitleTemplates(const QString &projectPath) ...@@ -679,7 +681,7 @@ void TitleWidget::refreshTitleTemplates(const QString &projectPath)
t.name = fname; t.name = fname;
t.file = folder.absoluteFilePath(fname); t.file = folder.absoluteFilePath(fname);
t.icon = QIcon(KThumb::getImage(QUrl::fromLocalFile(t.file), 0, 60, -1)); t.icon = QIcon(KThumb::getImage(QUrl::fromLocalFile(t.file), 0, 60, -1));
m_titleTemplates.append(t); titleTemplates.append(t);
} }
} }
} }
......
...@@ -86,7 +86,7 @@ public: ...@@ -86,7 +86,7 @@ public:
int duration() const; int duration() const;
/** @brief Retrieves a list of all available title templates. */ /** @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 */ /** @brief Returns a title name suggestion based on content */
const QString titleSuggest(); const QString titleSuggest();
...@@ -154,7 +154,7 @@ private: ...@@ -154,7 +154,7 @@ private:
PatternsModel *m_patternsModel; PatternsModel *m_patternsModel;
QList<TitleTemplate> m_titleTemplates; //QList<TitleTemplate> m_titleTemplates;
enum ValueType { ValueWidth = 1, ValueHeight = 2, ValueX = 4, ValueY = 8 }; enum ValueType { ValueWidth = 1, ValueHeight = 2, ValueX = 4, ValueY = 8 };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment