summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstandardpaths.cpp
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2015-01-06 11:44:22 +0100
committerDavid Faure <david.faure@kdab.com>2015-01-09 12:15:59 +0100
commit4c980aedc17c1da8f7160989fbb845ea72b36f44 (patch)
tree31ad4926d76d3a92585cd473a2ea5e01bc1e6f82 /src/corelib/io/qstandardpaths.cpp
parent3b9629e8bdbf23bb793c88f967b2cfe2b8256278 (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.cpp')
-rw-r--r--src/corelib/io/qstandardpaths.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index b41aee55d2..2e16c6d1ae 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -142,6 +142,10 @@ QT_BEGIN_NAMESPACE
\value AppLocalDataLocation Returns the local settings path on the Windows operating
system. On all other platforms, it returns the same value as AppDataLocation.
This enum value was added in Qt 5.4.
+ \value AppConfigLocation Returns a directory location where user-specific
+ configuration files should be written. This is an application-specific directory,
+ and the returned path is never empty.
+ This enum value was added in Qt 5.5.
The following table gives examples of paths on different operating systems.
The first path is the writable path (unless noted). Other, additional
@@ -206,6 +210,9 @@ QT_BEGIN_NAMESPACE
\row \li AppLocalDataLocation
\li "~/Library/Application Support/<APPNAME>", "/Library/Application Support/<APPNAME>". "<APPDIR>/../Resources"
\li "C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>", "<APPDIR>", "<APPDIR>/data"
+ \row \li AppConfigLocation
+ \li "~/Library/Preferences/<APPNAME>"
+ \li "C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>"
\endtable
\table
@@ -267,6 +274,9 @@ QT_BEGIN_NAMESPACE
\row \li AppLocalDataLocation
\li "<APPROOT>/data", "<APPROOT>/app/native/assets"
\li "~/.local/share/<APPNAME>", "/usr/local/share/<APPNAME>", "/usr/share/<APPNAME>"
+ \row \li AppConfigLocation
+ \li "<APPROOT>/data/Settings"
+ \li "~/.config/<APPNAME>", "/etc/xdg/<APPNAME>"
\endtable
\table
@@ -307,6 +317,8 @@ QT_BEGIN_NAMESPACE
\li "<APPROOT>/cache" (there is no shared cache)
\row \li AppDataLocation
\li "<APPROOT>/files", "<USER>/<APPNAME>/files"
+ \row \li AppConfigLocation
+ \li "<APPROOT>/files/settings"
\endtable
In the table above, \c <APPNAME> is usually the organization name, the
@@ -565,6 +577,8 @@ QString QStandardPaths::displayName(StandardLocation type)
case AppDataLocation:
case AppLocalDataLocation:
return QCoreApplication::translate("QStandardPaths", "Application Data");
+ case AppConfigLocation:
+ return QCoreApplication::translate("QStandardPaths", "Application Configuration");
}
// not reached
return QString();
@@ -585,7 +599,7 @@ QString QStandardPaths::displayName(StandardLocation type)
This affects the locations into which test programs might write files:
GenericDataLocation, DataLocation, ConfigLocation, GenericConfigLocation,
- GenericCacheLocation, CacheLocation.
+ AppConfigLocation, GenericCacheLocation, CacheLocation.
Other locations are not affected.
On Unix, \c XDG_DATA_HOME is set to \e ~/.qttest/share, \c XDG_CONFIG_HOME is