diff options
| author | Sandro Knauß <sknauss@kde.org> | 2016-03-22 16:18:21 +0100 | 
|---|---|---|
| committer | Sandro Knauß <sknauss@kde.org> | 2016-03-28 17:44:48 +0200 | 
| commit | 50f191eaba9b076675a52252dd8f2a5aaf5b1bb0 (patch) | |
| tree | b1913743e1ac75b76e6fb5632d3b899de5611a74 /src/core/kconfig.cpp | |
| parent | 43f8c1169524103eea0cbe624572c582b4d14494 (diff) | |
| download | kconfig-50f191eaba9b076675a52252dd8f2a5aaf5b1bb0.tar.gz kconfig-50f191eaba9b076675a52252dd8f2a5aaf5b1bb0.tar.bz2 | |
Add support for get QStandardPaths locations.
Inside desktop files we want to reach also data, cache and config home
to create files inside these directories.
REVIEW: 127462
CHANGELOG: Add support for get QStandardPaths locations inside desktop files.
Diffstat (limited to 'src/core/kconfig.cpp')
| -rw-r--r-- | src/core/kconfig.cpp | 8 | 
1 files changed, 8 insertions, 0 deletions
| diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp index 07fa6f55..9f17e579 100644 --- a/src/core/kconfig.cpp +++ b/src/core/kconfig.cpp @@ -221,6 +221,14 @@ QString KConfigPrivate::expandString(const QString &value)                      QByteArray pEnv = qgetenv(aVarName.toLatin1().constData());                      if (!pEnv.isEmpty()) {                          env = QString::fromLocal8Bit(pEnv.constData()); +                    } else { +                        if (aVarName == QStringLiteral("QT_DATA_HOME")) { +                            env = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); +                        } else if (aVarName == QStringLiteral("QT_CONFIG_HOME")) { +                            env = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); +                        } else if (aVarName == QStringLiteral("QT_CACHE_HOME")) { +			    env = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation); +                        }                      }                  }                  aValue.replace(nDollarPos, nEndPos - nDollarPos, env); | 
