Commit 8711a8e7 authored by David Faure's avatar David Faure
Browse files

Port from QStandardPaths::DataLocation to QStandardPaths::AppDataLocation

They are the same on Linux (but DataLocation is deprecated). On Windows this enables the use of the roaming path.

NO_CHANGELOG
parent 0e50b012
...@@ -80,7 +80,7 @@ Mainwindow::Mainwindow(QWidget *parent) ...@@ -80,7 +80,7 @@ Mainwindow::Mainwindow(QWidget *parent)
// Read theme files // Read theme files
QStringList themeList; QStringList themeList;
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("grafix"), QStandardPaths::LocateDirectory); const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("grafix"), QStandardPaths::LocateDirectory);
for (const QString& dir : dirs) { for (const QString& dir : dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.desktop")); const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.desktop"));
for (const QString& file : fileNames) { for (const QString& file : fileNames) {
......
...@@ -172,14 +172,14 @@ void ThemeManager::updateTheme(const QString &themefile) ...@@ -172,14 +172,14 @@ void ThemeManager::updateTheme(const QString &themefile)
mThemeFile = themefile; mThemeFile = themefile;
// Process dirs // Process dirs
QString rcfile = QStandardPaths::locate(QStandardPaths::DataLocation, "grafix/" + themefile); QString rcfile = QStandardPaths::locate(QStandardPaths::AppDataLocation, "grafix/" + themefile);
if (global_debug > 0) qCDebug(LSKAT_LOG) << "ThemeManager LOAD with theme " << rcfile; if (global_debug > 0) qCDebug(LSKAT_LOG) << "ThemeManager LOAD with theme " << rcfile;
// Read config and SVG file for theme // Read config and SVG file for theme
delete mConfig; delete mConfig;
mConfig = new KConfig(rcfile, KConfig::NoGlobals); mConfig = new KConfig(rcfile, KConfig::NoGlobals);
QString svgfile = config(QStringLiteral("general")).readEntry("svgfile"); QString svgfile = config(QStringLiteral("general")).readEntry("svgfile");
svgfile = QStandardPaths::locate(QStandardPaths::DataLocation, "grafix/" + svgfile); svgfile = QStandardPaths::locate(QStandardPaths::AppDataLocation, "grafix/" + svgfile);
if (global_debug > 0) qCDebug(LSKAT_LOG) << "Reading SVG master file =" << svgfile; if (global_debug > 0) qCDebug(LSKAT_LOG) << "Reading SVG master file =" << svgfile;
mAspectRatio = config(QStringLiteral("general")).readEntry("aspect-ratio", 1.0); mAspectRatio = config(QStringLiteral("general")).readEntry("aspect-ratio", 1.0);
......
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