Changeset View
Changeset View
Standalone View
Standalone View
3rdparty/ext_frameworks/kconfig.diff
- This file was added.
1 | diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp | ||||
---|---|---|---|---|---|
2 | index 3e0578f..6c4408d 100644 | ||||
3 | --- a/autotests/kconfigtest.cpp | ||||
4 | +++ b/autotests/kconfigtest.cpp | ||||
5 | @@ -587,7 +587,7 @@ void KConfigTest::testPathQtHome() | ||||
6 | qunsetenv("QT_CACHE_HOME"); | ||||
7 | qunsetenv("QT_CONFIG_HOME"); | ||||
8 | QVERIFY(group.hasKey("dataDir")); | ||||
9 | - QCOMPARE(group.readEntry("dataDir", QString()), QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation).append(QStringLiteral("/kconfigtest"))); | ||||
10 | + QCOMPARE(group.readEntry("dataDir", QString()), QStandardPaths::writableLocation(QStandardPaths::AppDataLocation).append(QStringLiteral("/kconfigtest"))); | ||||
11 | QVERIFY(group.hasKey("cacheDir")); | ||||
12 | QCOMPARE(group.readEntry("cacheDir", QString()), QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation).append(QStringLiteral("/kconfigtest"))); | ||||
13 | QVERIFY(group.hasKey("configDir")); | ||||
14 | diff --git a/autotests/kdesktopfiletest.cpp b/autotests/kdesktopfiletest.cpp | ||||
15 | index fd4a5c9..db08f22 100644 | ||||
16 | --- a/autotests/kdesktopfiletest.cpp | ||||
17 | +++ b/autotests/kdesktopfiletest.cpp | ||||
18 | @@ -222,7 +222,7 @@ void KDesktopFileTest::testIsAuthorizedDesktopFile() | ||||
19 | QVERIFY(QFile::exists(fileName)); | ||||
20 | QVERIFY(!KDesktopFile::isAuthorizedDesktopFile(fileName)); | ||||
21 | | ||||
22 | - const QString installedFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("/kservices5/http_cache_cleaner.desktop")); | ||||
23 | + const QString installedFile = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("/kservices5/http_cache_cleaner.desktop")); | ||||
24 | if (!installedFile.isEmpty()) { | ||||
25 | QVERIFY(KDesktopFile::isAuthorizedDesktopFile(installedFile)); | ||||
26 | } else { | ||||
27 | @@ -281,8 +281,8 @@ void KDesktopFileTest::testLocateLocal_data() | ||||
28 | { | ||||
29 | QString systemConfigLocation = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation).last(); | ||||
30 | QString writableConfigLocation = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); | ||||
31 | - QString systemDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).last(); | ||||
32 | - QString writableDataLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); | ||||
33 | + QString systemDataLocation = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).last(); | ||||
34 | + QString writableDataLocation = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); | ||||
35 | | ||||
36 | QTest::addColumn<QString>("path"); | ||||
37 | QTest::addColumn<QString>("result"); | ||||
38 | diff --git a/autotests/test_kconf_update.cpp b/autotests/test_kconf_update.cpp | ||||
39 | index 3353061..a80ae1e 100644 | ||||
40 | --- a/autotests/test_kconf_update.cpp | ||||
41 | +++ b/autotests/test_kconf_update.cpp | ||||
42 | @@ -625,7 +625,7 @@ void TestKConfUpdate::testScript() | ||||
43 | | ||||
44 | QSharedPointer<QTemporaryFile> updFile(writeUpdFile(updContent)); | ||||
45 | | ||||
46 | - const QString scriptDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kconf_update"; | ||||
47 | + const QString scriptDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/kconf_update"; | ||||
48 | QVERIFY(QDir().mkpath(scriptDir)); | ||||
49 | QString scriptPath = scriptDir + "/test.sh"; | ||||
50 | writeFile(scriptPath, updScript); | ||||
51 | diff --git a/docs/options.md b/docs/options.md | ||||
52 | index fab22e1..8823818 100644 | ||||
53 | --- a/docs/options.md | ||||
54 | +++ b/docs/options.md | ||||
55 | @@ -96,4 +96,4 @@ They are: | ||||
56 | | ||||
57 | * `$QT_CACHE_HOME` - QStandardPaths::GenericCacheLocation | ||||
58 | * `$QT_CONFIG_HOME` - QStandardPaths::GenericConfigLocation | ||||
59 | -* `$QT_DATA_HOME` - QStandardPaths::GenericDataLocation | ||||
60 | +* `$QT_DATA_HOME` - QStandardPaths::AppDataLocation | ||||
61 | diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp | ||||
62 | index c8eb90a..18d1b69 100644 | ||||
63 | --- a/src/core/kconfig.cpp | ||||
64 | +++ b/src/core/kconfig.cpp | ||||
65 | @@ -229,7 +229,7 @@ QString KConfigPrivate::expandString(const QString &value) | ||||
66 | env = QString::fromLocal8Bit(pEnv.constData()); | ||||
67 | } else { | ||||
68 | if (aVarName == QStringLiteral("QT_DATA_HOME")) { | ||||
69 | - env = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); | ||||
70 | + env = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); | ||||
71 | } else if (aVarName == QStringLiteral("QT_CONFIG_HOME")) { | ||||
72 | env = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); | ||||
73 | } else if (aVarName == QStringLiteral("QT_CACHE_HOME")) { | ||||
74 | diff --git a/src/core/kdesktopfile.cpp b/src/core/kdesktopfile.cpp | ||||
75 | index b0b6a87..daddd54 100644 | ||||
76 | --- a/src/core/kdesktopfile.cpp | ||||
77 | +++ b/src/core/kdesktopfile.cpp | ||||
78 | @@ -88,7 +88,7 @@ QString KDesktopFile::locateLocal(const QString &path) | ||||
79 | } | ||||
80 | } | ||||
81 | // Relative to xdg data dir? (much more common) | ||||
82 | - Q_FOREACH (const QString &dir, QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)) { | ||||
83 | + Q_FOREACH (const QString &dir, QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)) { | ||||
84 | if (path.startsWith(dir + plus)) { | ||||
85 | relativePath = path.mid(dir.length() + 1); | ||||
86 | } | ||||
87 | @@ -97,7 +97,7 @@ QString KDesktopFile::locateLocal(const QString &path) | ||||
88 | // What now? The desktop file doesn't come from XDG_DATA_DIRS. Use filename only and hope for the best. | ||||
89 | relativePath = path.mid(path.lastIndexOf(QLatin1Char('/')) + 1); | ||||
90 | } | ||||
91 | - return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + relativePath; | ||||
92 | + return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1Char('/') + relativePath; | ||||
93 | } | ||||
94 | | ||||
95 | bool KDesktopFile::isDesktopFile(const QString &path) | ||||
96 | @@ -134,7 +134,7 @@ bool KDesktopFile::isAuthorizedDesktopFile(const QString &path) | ||||
97 | } | ||||
98 | } | ||||
99 | const QString servicesDir = QStringLiteral("kservices5/"); // KGlobal::dirs()->xdgDataRelativePath("services") | ||||
100 | - Q_FOREACH (const QString &xdgDataPrefix, QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)) { | ||||
101 | + Q_FOREACH (const QString &xdgDataPrefix, QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)) { | ||||
102 | if (QDir(xdgDataPrefix).exists()) { | ||||
103 | const QString prefix = QFileInfo(xdgDataPrefix).canonicalFilePath(); | ||||
104 | if (realPath.startsWith(prefix + QLatin1Char('/') + servicesDir, sensitivity)) { | ||||
105 | diff --git a/src/kconf_update/kconf_update.cpp b/src/kconf_update/kconf_update.cpp | ||||
106 | index ab7d946..eeaf6ca 100644 | ||||
107 | --- a/src/kconf_update/kconf_update.cpp | ||||
108 | +++ b/src/kconf_update/kconf_update.cpp | ||||
109 | @@ -125,7 +125,7 @@ KonfUpdate::KonfUpdate(QCommandLineParser *parser) | ||||
110 | m_bUseConfigInfo = false; | ||||
111 | if (parser->isSet(QStringLiteral("check"))) { | ||||
112 | m_bUseConfigInfo = true; | ||||
113 | - const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kconf_update/" + parser->value(QStringLiteral("check"))); | ||||
114 | + const QString file = QStandardPaths::locate(QStandardPaths::AppDataLocation, "kconf_update/" + parser->value(QStringLiteral("check"))); | ||||
115 | if (file.isEmpty()) { | ||||
116 | qWarning("File '%s' not found.", parser->value(QStringLiteral("check")).toLocal8Bit().data()); | ||||
117 | log() << "File '" << parser->value(QStringLiteral("check")) << "' passed on command line not found" << endl; | ||||
118 | @@ -177,7 +177,7 @@ KonfUpdate::log() | ||||
119 | { | ||||
120 | if (!m_textStream) { | ||||
121 | #if 0 | ||||
122 | - QString dir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + "kconf_update/log"; | ||||
123 | + QString dir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1Char('/') + "kconf_update/log"; | ||||
124 | QDir().mkpath(dir); | ||||
125 | QString file = dir + "/update.log"; | ||||
126 | m_file = new QFile(file); | ||||
127 | @@ -206,7 +206,7 @@ QStringList KonfUpdate::findUpdateFiles(bool dirtyOnly) | ||||
128 | { | ||||
129 | QStringList result; | ||||
130 | | ||||
131 | - const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kconf_update"), QStandardPaths::LocateDirectory); | ||||
132 | + const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("kconf_update"), QStandardPaths::LocateDirectory); | ||||
133 | Q_FOREACH (const QString &d, dirs) { | ||||
134 | const QDir dir(d); | ||||
135 | | ||||
136 | @@ -760,7 +760,7 @@ void KonfUpdate::gotScript(const QString &_script) | ||||
137 | return; | ||||
138 | } | ||||
139 | | ||||
140 | - QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kconf_update/") + script); | ||||
141 | + QString path = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kconf_update/") + script); | ||||
142 | if (path.isEmpty()) { | ||||
143 | if (interpreter.isEmpty()) { | ||||
144 | path = CMAKE_INSTALL_PREFIX "/" LIB_INSTALL_DIR "/kconf_update_bin/" + script; |