Commit a3226740 authored by Julius Künzel's avatar Julius Künzel

Fix downloaded template titles and lumas not found on Windows

parent 7f303be5
......@@ -44,8 +44,12 @@ TitleTemplateDialog::TitleTemplateDialog(const QString &folder, QWidget *parent)
}
// System templates
const QStringList titleTemplates = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory);
QStringList titleTemplates = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory);
#ifdef Q_OS_WIN
// Windows: downloaded templatates are saved in AppLocalDataLocation
titleTemplates.append(QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory));
#endif
titleTemplates.removeDuplicates();
for (const QString &folderpath : titleTemplates) {
QDir sysdir(folderpath);
const QStringList filesnames = sysdir.entryList(filter, QDir::Files);
......
......@@ -221,7 +221,12 @@ void MltConnection::refreshLumas()
MainWindow::m_lumaFiles.clear();
fileFilters << QStringLiteral("*.png") << QStringLiteral("*.pgm");
QStringList customLumas = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("lumas"), QStandardPaths::LocateDirectory);
#ifdef Q_OS_WIN
// Windows: downloaded lumas are saved in AppLocalDataLocation
customLumas.append(QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("lumas"), QStandardPaths::LocateDirectory));
#endif
customLumas.append(QString(mlt_environment("MLT_DATA")) + QStringLiteral("/lumas"));
customLumas.removeDuplicates();
QStringList allImagefiles;
for (const QString &folder : qAsConst(customLumas)) {
QDir topDir(folder);
......
......@@ -654,6 +654,11 @@ void TitleWidget::refreshTitleTemplates(const QString &projectPath)
// system templates
QStringList titleTemplates = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory);
#ifdef Q_OS_WIN
// Windows: downloaded templatates are saved in AppLocalDataLocation
titleTemplates.append(QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory));
#endif
titleTemplates.removeDuplicates();
for (const QString &folderpath : qAsConst(titleTemplates)) {
QDir folder(folderpath);
QStringList filesnames = folder.entryList(filters, QDir::Files);
......
Markdown is supported
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