Commit 90b1e4f5 authored by Julius Künzel's avatar Julius Künzel
Browse files

Use AppLocalDataLocation on all plattform to finde KNS items

The Qt doc sais: "AppLocalDataLocation returns the local settings path
on the Windows operating system. On all other platforms, it returns the
same value as AppDataLocation." So we don't need a OS check in the code
and can simply always use AppLocalDataLocation.
parent dde8a674
Pipeline #105026 passed with stage
in 9 minutes and 18 seconds
......@@ -115,13 +115,9 @@ void UrlListParamWidget::slotRefresh()
// special case: LUT files
values.clear();
names.clear();
// check for Kdenlive installed luts files
QStringList customLuts = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("luts"), QStandardPaths::LocateDirectory);
#ifdef Q_OS_WIN
// Windows downloaded lumas are saved in AppLocalDataLocation
customLuts.append(QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("luts"), QStandardPaths::LocateDirectory));
#endif
// check for Kdenlive installed luts files
QStringList customLuts = QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("luts"), QStandardPaths::LocateDirectory);
for (const QString &folderpath : qAsConst(customLuts)) {
QDir dir(folderpath);
QDirIterator it(dir.absolutePath(), m_fileExt, QDir::Files, QDirIterator::Subdirectories);
......
......@@ -2092,16 +2092,7 @@ void RenderWidget::parseProfiles(const QString &selectedProfile)
// Parse some MLT's profiles
parseMltPresets();
QStringList filter = {QStringLiteral("*.xml")};
#ifdef Q_OS_WIN
// Windows downloaded profiles are saved in AppLocalDataLocation
QString localExportFolder = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QStringLiteral("/export/");
QDir winDir(localExportFolder);
QStringList winFileList = winDir.entryList(filter, QDir::Files);
for (const QString &filename : winFileList) {
parseFile(winDir.absoluteFilePath(filename), true);
}
#endif
QString exportFolder = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/export/");
QString exportFolder = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QStringLiteral("/export/");
QDir directory(exportFolder);
QStringList fileList = directory.entryList(filter, QDir::Files);
// We should parse customprofiles.xml in last position, so that user profiles
......
......@@ -30,11 +30,7 @@ TitleTemplateDialog::TitleTemplateDialog(const QString &folder, QWidget *parent)
}
// 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
QStringList titleTemplates = QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory);
titleTemplates.removeDuplicates();
for (const QString &folderpath : qAsConst(titleTemplates)) {
QDir sysdir(folderpath);
......
......@@ -666,11 +666,7 @@ 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
QStringList titleTemplates = QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory);
titleTemplates.removeDuplicates();
for (const QString &folderpath : qAsConst(titleTemplates)) {
QDir folder(folderpath);
......
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