Warning, /graphics/krita/3rdparty/ext_frameworks/0001-Patch-kconfig-to-save-the-config-to-AppConfigLocatio.patch is written in an unsupported language. File is not indexed.
0001 From 4622cea47c248db71b423e1662ec3f01a3c0802f Mon Sep 17 00:00:00 2001 0002 From: Boudewijn Rempt <boud@valdyas.org> 0003 Date: Thu, 12 May 2016 20:15:40 +0200 0004 Subject: [PATCH 1/2] Patch kconfig to save the config to AppConfigLocation 0005 0006 I don't know why anyone would want an application to save its 0007 configuration to GenericConfigLocation, after all, we're an 0008 application, not a system level component. But this seems the 0009 only way to fix kconfig to do the sane thing. 0010 --- 0011 docs/options.md | 2 +- 0012 src/core/kdesktopfile.cpp | 8 +++++--- 0013 src/kconf_update/kconf_update.cpp | 6 +++--- 0014 3 files changed, 9 insertions(+), 7 deletions(-) 0015 0016 diff --git a/docs/options.md b/docs/options.md 0017 index b57713de..404a3238 100644 0018 --- a/docs/options.md 0019 +++ b/docs/options.md 0020 @@ -93,4 +93,4 @@ They are: 0021 0022 * `$QT_CACHE_HOME` - QStandardPaths::GenericCacheLocation 0023 * `$QT_CONFIG_HOME` - QStandardPaths::GenericConfigLocation 0024 -* `$QT_DATA_HOME` - QStandardPaths::GenericDataLocation 0025 +* `$QT_DATA_HOME` - QStandardPaths::AppDataLocation 0026 diff --git a/src/core/kdesktopfile.cpp b/src/core/kdesktopfile.cpp 0027 index 95645a63..50048e5f 100644 0028 --- a/src/core/kdesktopfile.cpp 0029 +++ b/src/core/kdesktopfile.cpp 0030 @@ -71,13 +71,14 @@ QString KDesktopFile::locateLocal(const QString &path) 0031 static const QLatin1Char slash('/'); 0032 0033 // Relative to config? (e.g. for autostart) 0034 - const QStringList genericConfig = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation); 0035 + const QStringList genericConfig = 0036 + QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); 0037 // Iterate from the last item since some items may be subfolders of others. 0038 auto it = std::find_if(genericConfig.crbegin(), genericConfig.crend(), [&path](const QString &dir) { 0039 return path.startsWith(dir + slash); 0040 }); 0041 if (it != genericConfig.crend()) { 0042 - return QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + slash + QStringView(path).mid(it->size() + 1); 0043 + return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + slash + QStringView(path).mid(it->size() + 1); 0044 } 0045 0046 QString relativePath; 0047 @@ -132,7 +133,8 @@ bool KDesktopFile::isAuthorizedDesktopFile(const QString &path) 0048 } 0049 0050 const QString servicesDir = QStringLiteral("kservices5/"); // KGlobal::dirs()->xdgDataRelativePath("services") 0051 - const QStringList genericData = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); 0052 + const QStringList genericData = 0053 + QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); 0054 auto genericIt = std::find_if(genericData.cbegin(), genericData.cend(), [&realPath, &servicesDir, sensitivity](const QString &xdgDataPrefix) { 0055 QFileInfo info(xdgDataPrefix); 0056 if (info.exists() && info.isDir()) { 0057 diff --git a/src/kconf_update/kconf_update.cpp b/src/kconf_update/kconf_update.cpp 0058 index 18692e3a..5ba9f531 100644 0059 --- a/src/kconf_update/kconf_update.cpp 0060 +++ b/src/kconf_update/kconf_update.cpp 0061 @@ -146,7 +146,7 @@ KonfUpdate::KonfUpdate(QCommandLineParser *parser) 0062 if (parser->isSet(QStringLiteral("check"))) { 0063 m_bUseConfigInfo = true; 0064 const QString file = 0065 - QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String{"kconf_update/"} + parser->value(QStringLiteral("check"))); 0066 + QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String{"kconf_update/"} + parser->value(QStringLiteral("check"))); 0067 if (file.isEmpty()) { 0068 qWarning("File '%s' not found.", parser->value(QStringLiteral("check")).toLocal8Bit().data()); 0069 qCDebug(KCONF_UPDATE_LOG) << "File" << parser->value(QStringLiteral("check")) << "passed on command line not found"; 0070 @@ -192,7 +192,7 @@ QStringList KonfUpdate::findUpdateFiles(bool dirtyOnly) 0071 { 0072 QStringList result; 0073 0074 - const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kconf_update"), QStandardPaths::LocateDirectory); 0075 + const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("kconf_update"), QStandardPaths::LocateDirectory); 0076 for (const QString &d : dirs) { 0077 const QDir dir(d); 0078 0079 @@ -762,7 +762,7 @@ void KonfUpdate::gotScript(const QString &_script) 0080 return; 0081 } 0082 0083 - QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("kconf_update/") + script); 0084 + QString path = QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String("kconf_update/") + script); 0085 if (path.isEmpty()) { 0086 if (interpreter.isEmpty()) { 0087 path = QLatin1String{CMAKE_INSTALL_PREFIX "/" LIB_INSTALL_DIR "/kconf_update_bin/"} + script; 0088 -- 0089 2.37.1.windows.1 0090