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 c0ae653c7ed4faa0bba846bb83a41b68a6e48fa6 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         | 10 +++++-----
0013  src/kconf_update/kconf_update.cpp |  6 +++---
0014  3 files changed, 9 insertions(+), 9 deletions(-)
0015 
0016 diff --git a/docs/options.md b/docs/options.md
0017 index 4a6e9bc..caca9f8 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 18ef852..c9691a0 100644
0028 --- a/src/core/kdesktopfile.cpp
0029 +++ b/src/core/kdesktopfile.cpp
0030 @@ -82,11 +82,11 @@ QString KDesktopFile::locateLocal(const QString &path)
0031      QString relativePath;
0032      QChar plus(QLatin1Char('/'));
0033      // Relative to config? (e.g. for autostart)
0034 -    const QStringList lstGenericConfigLocation = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation);
0035 -    for (const QString &dir : lstGenericConfigLocation) {
0036 +    const QStringList lstAppDataLocation = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
0037 +    for (const QString &dir : lstAppDataLocation) {
0038          if (path.startsWith(dir + plus)) {
0039              relativePath = path.mid(dir.length() + 1);
0040 -            return QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + relativePath;
0041 +            return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1Char('/') + relativePath;
0042          }
0043      }
0044      // Relative to xdg data dir? (much more common)
0045 @@ -137,8 +137,8 @@ bool KDesktopFile::isAuthorizedDesktopFile(const QString &path)
0046          }
0047      }
0048      const QString servicesDir = QStringLiteral("kservices5/"); // KGlobal::dirs()->xdgDataRelativePath("services")
0049 -    const QStringList lstGenericDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
0050 -    for (const QString &xdgDataPrefix : lstGenericDataLocation) {
0051 +    const QStringList lstAppDataLocation = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
0052 +    for (const QString &xdgDataPrefix : lstAppDataLocation) {
0053          if (QDir(xdgDataPrefix).exists()) {
0054              const QString prefix = QFileInfo(xdgDataPrefix).canonicalFilePath();
0055              if (realPath.startsWith(prefix + QLatin1Char('/') + servicesDir, sensitivity)) {
0056 diff --git a/src/kconf_update/kconf_update.cpp b/src/kconf_update/kconf_update.cpp
0057 index 2c48fa3..580d89c 100644
0058 --- a/src/kconf_update/kconf_update.cpp
0059 +++ b/src/kconf_update/kconf_update.cpp
0060 @@ -145,7 +145,7 @@ KonfUpdate::KonfUpdate(QCommandLineParser *parser)
0061      m_bUseConfigInfo = false;
0062      if (parser->isSet(QStringLiteral("check"))) {
0063          m_bUseConfigInfo = true;
0064 -        const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kconf_update/" + parser->value(QStringLiteral("check")));
0065 +        const QString file = QStandardPaths::locate(QStandardPaths::AppDataLocation, "kconf_update/" + parser->value(QStringLiteral("check")));
0066          if (file.isEmpty()) {
0067              qWarning("File '%s' not found.", parser->value(QStringLiteral("check")).toLocal8Bit().data());
0068              qCDebug(KCONF_UPDATE_LOG) << "File" << parser->value(QStringLiteral("check")) << "passed on command line not found";
0069 @@ -190,7 +190,7 @@ QStringList KonfUpdate::findUpdateFiles(bool dirtyOnly)
0070  {
0071      QStringList result;
0072  
0073 -    const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kconf_update"), QStandardPaths::LocateDirectory);
0074 +    const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("kconf_update"), QStandardPaths::LocateDirectory);
0075      for (const QString &d : dirs) {
0076          const QDir dir(d);
0077  
0078 @@ -754,7 +754,7 @@ void KonfUpdate::gotScript(const QString &_script)
0079          return;
0080      }
0081  
0082 -    QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("kconf_update/") + script);
0083 +    QString path = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kconf_update/") + script);
0084      if (path.isEmpty()) {
0085          if (interpreter.isEmpty()) {
0086              path = CMAKE_INSTALL_PREFIX "/" LIB_INSTALL_DIR "/kconf_update_bin/" + script;
0087 -- 
0088 2.30.1.windows.1
0089