From 50f191eaba9b076675a52252dd8f2a5aaf5b1bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Tue, 22 Mar 2016 16:18:21 +0100 Subject: 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. --- src/core/kconfig.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/kconfig.cpp') 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); -- cgit v1.2.1