kconfig.diff 5.18 KB
Newer Older
1
diff --git a/docs/options.md b/docs/options.md
2
index c634c00..5e59219 100644
3 4 5 6
--- a/docs/options.md
+++ b/docs/options.md
@@ -96,4 +96,4 @@ They are:
 
7 8 9 10
 * `$QT_CACHE_HOME` - QStandardPaths::GenericCacheLocation
 * `$QT_CONFIG_HOME` - QStandardPaths::GenericConfigLocation
-* `$QT_DATA_HOME` - QStandardPaths::GenericDataLocation
+* `$QT_DATA_HOME` - QStandardPaths::AppDataLocation
11
diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp
12
index e1b11ed..e3511cf 100644
13 14
--- a/src/core/kconfig.cpp
+++ b/src/core/kconfig.cpp
15
@@ -237,7 +237,7 @@ QString KConfigPrivate::expandString(const QString &value)
16 17 18 19 20 21 22 23
                         env = QString::fromLocal8Bit(pEnv.constData());
                     } else {
                         if (aVarName == QStringLiteral("QT_DATA_HOME")) {
-                            env = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
+                            env = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
                         } else if (aVarName == QStringLiteral("QT_CONFIG_HOME")) {
                             env = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
                         } else if (aVarName == QStringLiteral("QT_CACHE_HOME")) {
24
diff --git a/src/core/kdesktopfile.cpp b/src/core/kdesktopfile.cpp
25
index d9283ce..f869fb0 100644
26 27
--- a/src/core/kdesktopfile.cpp
+++ b/src/core/kdesktopfile.cpp
28
@@ -89,8 +89,8 @@ QString KDesktopFile::locateLocal(const QString &path)
29 30 31
         }
     }
     // Relative to xdg data dir? (much more common)
32 33 34 35
-    const QStringList lstGenericDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
-    for (const QString &dir : lstGenericDataLocation) {
+    const QStringList lstAppDataLocation = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
+    for (const QString &dir : lstAppDataLocation) {
36
         if (path.startsWith(dir + plus)) {
37
             relativePath = path.mid(dir.length() + 1);
38
         }
39
@@ -99,7 +99,7 @@ QString KDesktopFile::locateLocal(const QString &path)
40 41
         // What now? The desktop file doesn't come from XDG_DATA_DIRS. Use filename only and hope for the best.
         relativePath = path.mid(path.lastIndexOf(QLatin1Char('/')) + 1);
42
     }
43 44 45 46 47
-    return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + relativePath;
+    return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1Char('/') + relativePath;
 }
 
 bool KDesktopFile::isDesktopFile(const QString &path)
48
@@ -136,8 +136,8 @@ bool KDesktopFile::isAuthorizedDesktopFile(const QString &path)
49 50
         }
     }
51
     const QString servicesDir = QStringLiteral("kservices5/"); // KGlobal::dirs()->xdgDataRelativePath("services")
52 53 54 55
-    const QStringList lstGenericDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
-    for (const QString &xdgDataPrefix : lstGenericDataLocation) {
+    const QStringList lstAppDataLocation = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
+    for (const QString &xdgDataPrefix : lstAppDataLocation) {
56 57
         if (QDir(xdgDataPrefix).exists()) {
             const QString prefix = QFileInfo(xdgDataPrefix).canonicalFilePath();
58
             if (realPath.startsWith(prefix + QLatin1Char('/') + servicesDir, sensitivity)) {
59
diff --git a/src/kconf_update/kconf_update.cpp b/src/kconf_update/kconf_update.cpp
60
index f6c7653..f9b83ac 100644
61 62
--- a/src/kconf_update/kconf_update.cpp
+++ b/src/kconf_update/kconf_update.cpp
63
@@ -145,7 +145,7 @@ KonfUpdate::KonfUpdate(QCommandLineParser *parser)
64 65 66 67 68 69 70
     m_bUseConfigInfo = false;
     if (parser->isSet(QStringLiteral("check"))) {
         m_bUseConfigInfo = true;
-        const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kconf_update/" + parser->value(QStringLiteral("check")));
+        const QString file = QStandardPaths::locate(QStandardPaths::AppDataLocation, "kconf_update/" + parser->value(QStringLiteral("check")));
         if (file.isEmpty()) {
             qWarning("File '%s' not found.", parser->value(QStringLiteral("check")).toLocal8Bit().data());
71 72
             qCDebug(KCONF_UPDATE_LOG) << "File" << parser->value(QStringLiteral("check")) << "passed on command line not found";
@@ -190,7 +190,7 @@ QStringList KonfUpdate::findUpdateFiles(bool dirtyOnly)
73 74 75 76 77
 {
     QStringList result;
 
-    const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kconf_update"), QStandardPaths::LocateDirectory);
+    const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("kconf_update"), QStandardPaths::LocateDirectory);
78
     for (const QString &d : dirs) {
79 80
         const QDir dir(d);
 
81
@@ -751,7 +751,7 @@ void KonfUpdate::gotScript(const QString &_script)
82 83
         return;
     }
84
 
85 86 87 88 89
-    QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kconf_update/") + script);
+    QString path = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kconf_update/") + script);
     if (path.isEmpty()) {
         if (interpreter.isEmpty()) {
             path = CMAKE_INSTALL_PREFIX "/" LIB_INSTALL_DIR "/kconf_update_bin/" + script;