From 4c980aedc17c1da8f7160989fbb845ea72b36f44 Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 6 Jan 2015 11:44:22 +0100 Subject: QStandardPaths: add AppConfigLocation. ConfigLocation was erroneously inconsistent, by adding the org name and app name on Windows (unintentionally) and not on Unix (while having subdirs in ~/.config is actually common practice for some XDG desktops) Therefore this adds AppConfigLocation, which always has the org name and app name (while GenericConfigLocation never does). [ChangeLog][QtCore][QStandardPaths] Added QStandardPaths::AppConfigLocation, for application-specific configuration directory. ConfigLocation was inconsistent. Task-number: QTBUG-38872 Task-number: QTBUG-38845 Change-Id: I80fb98f296436261f3996c9df87571c29b06ab35 Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- src/corelib/io/qstandardpaths_mac.mm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/corelib/io/qstandardpaths_mac.mm') diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm index 01d1c01f78..4cd71d7d52 100644 --- a/src/corelib/io/qstandardpaths_mac.mm +++ b/src/corelib/io/qstandardpaths_mac.mm @@ -53,6 +53,7 @@ OSType translateLocation(QStandardPaths::StandardLocation type) switch (type) { case QStandardPaths::ConfigLocation: case QStandardPaths::GenericConfigLocation: + case QStandardPaths::AppConfigLocation: return kPreferencesFolderType; case QStandardPaths::DesktopLocation: return kDesktopFolderType; @@ -129,7 +130,8 @@ static QString macLocation(QStandardPaths::StandardLocation type, short domain) QString path = getFullPath(ref); - if (type == QStandardPaths::AppDataLocation || type == QStandardPaths::AppLocalDataLocation || type == QStandardPaths::CacheLocation) + if (type == QStandardPaths::AppDataLocation || type == QStandardPaths::AppLocalDataLocation || + type == QStandardPaths::CacheLocation || type == QStandardPaths::AppConfigLocation) appendOrganizationAndApp(path); return path; } @@ -155,7 +157,11 @@ QString QStandardPaths::writableLocation(StandardLocation type) return path; case GenericConfigLocation: case ConfigLocation: - return qttestDir + QLatin1String("/Preferences"); + case AppConfigLocation: + path = qttestDir + QLatin1String("/Preferences"); + if (type == AppConfigLocation) + appendOrganizationAndApp(path); + return path; default: break; } -- cgit v1.2.3