summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstandardpaths_mac.mm
diff options
context:
space:
mode:
authorBjörn Feber <bfeber@protonmail.com>2021-07-22 22:29:01 +0200
committerBjörn Feber <bfeber@protonmail.com>2022-01-01 18:34:30 +0200
commit68c4669ce49aad21beff0e8ef0122a86d53b12e2 (patch)
tree01991f4393bf8cf2b12a0f6e28e28565906fd575 /src/corelib/io/qstandardpaths_mac.mm
parentffcf4f400102aa3626bcf1dda6f8a703553f59f7 (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_mac.mm')
-rw-r--r--src/corelib/io/qstandardpaths_mac.mm9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm
index a95e6a3bb1..8c102d6928 100644
--- a/src/corelib/io/qstandardpaths_mac.mm
+++ b/src/corelib/io/qstandardpaths_mac.mm
@@ -85,6 +85,9 @@ static NSSearchPathDirectory searchPathDirectory(QStandardPaths::StandardLocatio
return NSCachesDirectory;
case QStandardPaths::DownloadLocation:
return NSDownloadsDirectory;
+ case QStandardPaths::PublicShareLocation:
+ return NSSharedPublicDirectory;
+ case QStandardPaths::TemplatesLocation:
default:
return (NSSearchPathDirectory)0;
}
@@ -136,6 +139,12 @@ static QString baseWritableLocation(QStandardPaths::StandardLocation type,
break;
case QStandardPaths::ApplicationsLocation:
break;
+ case QStandardPaths::PublicShareLocation:
+ path = pathForDirectory(NSDocumentDirectory, mask) + QLatin1String("/Public");
+ break;
+ case QStandardPaths::TemplatesLocation:
+ path = pathForDirectory(NSDocumentDirectory, mask) + QLatin1String("/Templates");
+ break;
#endif
case QStandardPaths::FontsLocation:
path = pathForDirectory(NSLibraryDirectory, mask) + QLatin1String("/Fonts");