diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qstandardpaths_mac.mm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm index 7b97a03db2..f65ca2048a 100644 --- a/src/corelib/io/qstandardpaths_mac.mm +++ b/src/corelib/io/qstandardpaths_mac.mm @@ -229,6 +229,14 @@ QString QStandardPaths::displayName(StandardLocation type) if (QStandardPaths::HomeLocation == type) return QCoreApplication::translate("QStandardPaths", "Home"); + if (QStandardPaths::DownloadLocation == type) { + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSURL *url = [fileManager URLForDirectory:NSDownloadsDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; + if (!url) + return QString(); + return QString::fromNSString([fileManager displayNameAtPath: [url absoluteString]]); + } + FSRef ref; OSErr err = FSFindFolder(kOnAppropriateDisk, translateLocation(type), false, &ref); if (err) |