diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qstandardpaths.cpp | 7 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths.h | 3 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths_blackberry.cpp | 1 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths_ios.mm | 1 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths_mac.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths_unix.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths_win.cpp | 10 |
7 files changed, 20 insertions, 6 deletions
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index 186321db6e..2207b8c43e 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -95,6 +95,9 @@ QT_BEGIN_NAMESPACE files should be written. For instance unix local sockets. \value ConfigLocation Returns a directory location where user-specific configuration files should be written. + \value GenericConfigLocation Returns a directory location where user-specific + configuration files shared between multiple applications should be written. + This is a generic value and the returned path is never empty. \value DownloadLocation Returns a directory for user's downloaded files. @@ -335,6 +338,8 @@ QString QStandardPaths::displayName(StandardLocation type) return QCoreApplication::translate("QStandardPaths", "Runtime"); case ConfigLocation: return QCoreApplication::translate("QStandardPaths", "Configuration"); + case GenericConfigLocation: + return QCoreApplication::translate("QStandardPaths", "Shared Configuration"); case GenericCacheLocation: return QCoreApplication::translate("QStandardPaths", "Shared Cache"); case DownloadLocation: @@ -358,7 +363,7 @@ QString QStandardPaths::displayName(StandardLocation type) or writing to the current user's configuration. This affects the locations into which test programs might write files: - GenericDataLocation, DataLocation, ConfigLocation, + GenericDataLocation, DataLocation, ConfigLocation, GenericConfigLocation, GenericCacheLocation, CacheLocation. Other locations are not affected. diff --git a/src/corelib/io/qstandardpaths.h b/src/corelib/io/qstandardpaths.h index df9089ace7..08d6d7b50c 100644 --- a/src/corelib/io/qstandardpaths.h +++ b/src/corelib/io/qstandardpaths.h @@ -69,7 +69,8 @@ public: RuntimeLocation, ConfigLocation, DownloadLocation, - GenericCacheLocation + GenericCacheLocation, + GenericConfigLocation }; static QString writableLocation(StandardLocation type); diff --git a/src/corelib/io/qstandardpaths_blackberry.cpp b/src/corelib/io/qstandardpaths_blackberry.cpp index a801c2fba3..815756ff9a 100644 --- a/src/corelib/io/qstandardpaths_blackberry.cpp +++ b/src/corelib/io/qstandardpaths_blackberry.cpp @@ -75,6 +75,7 @@ QString QStandardPaths::writableLocation(StandardLocation type) case GenericCacheLocation: return QDir::homePath() + testModeInsert() + QLatin1String("/Cache"); case ConfigLocation: + case GenericConfigLocation: return QDir::homePath() + testModeInsert() + QLatin1String("/Settings"); case GenericDataLocation: return sharedRoot + testModeInsert() + QLatin1String("/misc"); diff --git a/src/corelib/io/qstandardpaths_ios.mm b/src/corelib/io/qstandardpaths_ios.mm index 332400eaf2..e2100045a6 100644 --- a/src/corelib/io/qstandardpaths_ios.mm +++ b/src/corelib/io/qstandardpaths_ios.mm @@ -99,6 +99,7 @@ QString QStandardPaths::writableLocation(StandardLocation type) location = pathForDirectory(NSCachesDirectory); break; case ConfigLocation: + case GenericConfigLocation: location = pathForDirectory(NSDocumentDirectory); break; case DownloadLocation: diff --git a/src/corelib/io/qstandardpaths_mac.cpp b/src/corelib/io/qstandardpaths_mac.cpp index 6744bfeab4..0efdfae253 100644 --- a/src/corelib/io/qstandardpaths_mac.cpp +++ b/src/corelib/io/qstandardpaths_mac.cpp @@ -58,6 +58,7 @@ OSType translateLocation(QStandardPaths::StandardLocation type) { switch (type) { case QStandardPaths::ConfigLocation: + case QStandardPaths::GenericConfigLocation: return kPreferencesFolderType; case QStandardPaths::DesktopLocation: return kDesktopFolderType; @@ -149,6 +150,7 @@ QString QStandardPaths::writableLocation(StandardLocation type) if (type == CacheLocation) appendOrganizationAndApp(path); return path; + case GenericConfigLocation: case ConfigLocation: return qttestDir + QLatin1String("/Preferences"); default: diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp index 61e2e03a3d..1b9078f712 100644 --- a/src/corelib/io/qstandardpaths_unix.cpp +++ b/src/corelib/io/qstandardpaths_unix.cpp @@ -103,6 +103,7 @@ QString QStandardPaths::writableLocation(StandardLocation type) return xdgDataHome; } case ConfigLocation: + case GenericConfigLocation: { // http://standards.freedesktop.org/basedir-spec/latest/ QString xdgConfigHome = QFile::decodeName(qgetenv("XDG_CONFIG_HOME")); @@ -277,6 +278,7 @@ QStringList QStandardPaths::standardLocations(StandardLocation type) QStringList dirs; switch (type) { case ConfigLocation: + case GenericConfigLocation: { // http://standards.freedesktop.org/basedir-spec/latest/ const QString xdgConfigDirs = QFile::decodeName(qgetenv("XDG_CONFIG_DIRS")); diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp index d4e0779381..6a79c7c00b 100644 --- a/src/corelib/io/qstandardpaths_win.cpp +++ b/src/corelib/io/qstandardpaths_win.cpp @@ -99,7 +99,8 @@ QString QStandardPaths::writableLocation(StandardLocation type) wchar_t path[MAX_PATH]; switch (type) { - case ConfigLocation: // same as DataLocation, on Windows + case ConfigLocation: // same as DataLocation, on Windows (oversight, but too late to fix it) + case GenericConfigLocation: // same as GenericDataLocation, on Windows case DataLocation: case GenericDataLocation: #if defined Q_OS_WINCE @@ -111,7 +112,7 @@ QString QStandardPaths::writableLocation(StandardLocation type) if (isTestModeEnabled()) result += QLatin1String("/qttest"); #ifndef QT_BOOTSTRAPPED - if (type != GenericDataLocation) { + if (type != GenericDataLocation && type != GenericConfigLocation) { if (!QCoreApplication::organizationName().isEmpty()) result += QLatin1Char('/') + QCoreApplication::organizationName(); if (!QCoreApplication::applicationName().isEmpty()) @@ -188,12 +189,13 @@ QStringList QStandardPaths::standardLocations(StandardLocation type) if (SHGetSpecialFolderPath) { wchar_t path[MAX_PATH]; switch (type) { - case ConfigLocation: // same as DataLocation, on Windows + case ConfigLocation: // same as DataLocation, on Windows (oversight, but too late to fix it) + case GenericConfigLocation: // same as GenericDataLocation, on Windows case DataLocation: case GenericDataLocation: if (SHGetSpecialFolderPath(0, path, CSIDL_COMMON_APPDATA, FALSE)) { QString result = convertCharArray(path); - if (type != GenericDataLocation) { + if (type != GenericDataLocation && type != GenericConfigLocation) { #ifndef QT_BOOTSTRAPPED if (!QCoreApplication::organizationName().isEmpty()) result += QLatin1Char('/') + QCoreApplication::organizationName(); |