diff options
author | Björn Feber <bfeber@protonmail.com> | 2021-07-22 22:29:01 +0200 |
---|---|---|
committer | Björn Feber <bfeber@protonmail.com> | 2022-01-01 18:34:30 +0200 |
commit | 68c4669ce49aad21beff0e8ef0122a86d53b12e2 (patch) | |
tree | 01991f4393bf8cf2b12a0f6e28e28565906fd575 /src/corelib/io/qstandardpaths.cpp | |
parent | ffcf4f400102aa3626bcf1dda6f8a703553f59f7 (diff) |
Add PublicShare and Templates QStandardPaths
These directories are common on desktop operating systems. "Public" is
used for sharing files with other users and "Templates" lets you add new
files to the file creation desktop menu (for example in a file
manager). An example use in a Qt application would be KDE's KIO having
default icons for both directories.
This is where they point to:
Windows: C:/Users/Public, C:/Users/<USER>/AppData/Roaming/Microsoft/Windows/Templates
macOS: ~/Public, ~/Templates
Unix: ~/Public, ~/Templates
Task-number: QTBUG-86106
Task-number: QTBUG-78092
Change-Id: Ifca60c7d2a6dc2109ec290e8fb109ee2d5ca4d38
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qstandardpaths.cpp')
-rw-r--r-- | src/corelib/io/qstandardpaths.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index b76eafcb89..e07cea451b 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -153,6 +153,14 @@ QT_BEGIN_NAMESPACE 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. + \value PublicShareLocation Returns a directory location where user-specific publicly shared files + and directories can be stored. This is a generic value. Note that the returned path may be + empty if the system has no concept of a publicly shared location. + This enum value was added in Qt 6.3. + \value TemplatesLocation Returns a directory location where user-specific + template files can be stored. This is a generic value. Note that the returned path may be + empty if the system has no concept of a templates location. + This enum value was added in Qt 6.3. The following table gives examples of paths on different operating systems. The first path is the writable path (unless noted). Other, additional @@ -217,6 +225,12 @@ QT_BEGIN_NAMESPACE \row \li AppConfigLocation \li "~/Library/Preferences/<APPNAME>" \li "C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>" + \row \li PublicShareLocation + \li "~/Public" + \li "C:/Users/Public" + \row \li TemplatesLocation + \li "~/Templates" + \li "C:/Users/<USER>/AppData/Roaming/Microsoft/Windows/Templates" \endtable \table @@ -259,6 +273,10 @@ QT_BEGIN_NAMESPACE \li "~/.local/share/<APPNAME>", "/usr/local/share/<APPNAME>", "/usr/share/<APPNAME>" \row \li AppConfigLocation \li "~/.config/<APPNAME>", "/etc/xdg/<APPNAME>" + \row \li PublicShareLocation + \li "~/Public" + \row \li TemplatesLocation + \li "~/Templates" \endtable \table @@ -320,6 +338,12 @@ QT_BEGIN_NAMESPACE \row \li AppConfigLocation \li "<APPROOT>/files/settings" \li "<APPROOT>/Library/Preferences/<APPNAME>" + \row \li PublicShareLocation + \li not supported + \li not supported + \row \li TemplatesLocation + \li not supported + \li not supported \endtable In the table above, \c <APPNAME> is usually the organization name, the @@ -572,6 +596,10 @@ QString QStandardPaths::displayName(StandardLocation type) case AppDataLocation: case AppConfigLocation: return QCoreApplication::translate("QStandardPaths", "Application Configuration"); + case PublicShareLocation: + return QCoreApplication::translate("QStandardPaths", "Public"); + case TemplatesLocation: + return QCoreApplication::translate("QStandardPaths", "Templates"); } // not reached return QString(); |