diff options
author | David Faure <david.faure@kdab.com> | 2015-01-06 11:44:22 +0100 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2015-01-09 12:15:59 +0100 |
commit | 4c980aedc17c1da8f7160989fbb845ea72b36f44 (patch) | |
tree | 31ad4926d76d3a92585cd473a2ea5e01bc1e6f82 /src/corelib/io/qstandardpaths_mac.mm | |
parent | 3b9629e8bdbf23bb793c88f967b2cfe2b8256278 (diff) |
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 <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qstandardpaths_mac.mm')
-rw-r--r-- | src/corelib/io/qstandardpaths_mac.mm | 10 |
1 files changed, 8 insertions, 2 deletions
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; } |