summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstandardpaths_ios.mm
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-04 05:56:06 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-06-04 05:56:06 +0000
commitccad00121d0a9d703cf715c54347b32bfc33bbfc (patch)
tree8e492f00f9ea81d87ae9126ad06c3dbc21fee3a3 /src/corelib/io/qstandardpaths_ios.mm
parentdc2617f35be61b4827b8e3d192c85e2feacf7f6a (diff)
parente2f66f921594b7be4af4a058c959557489e86879 (diff)
Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/io/qstandardpaths_ios.mm')
-rw-r--r--src/corelib/io/qstandardpaths_ios.mm29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/corelib/io/qstandardpaths_ios.mm b/src/corelib/io/qstandardpaths_ios.mm
index 27d28526c2..eb85e2fd23 100644
--- a/src/corelib/io/qstandardpaths_ios.mm
+++ b/src/corelib/io/qstandardpaths_ios.mm
@@ -55,30 +55,31 @@ QString QStandardPaths::writableLocation(StandardLocation type)
QString location;
switch (type) {
- case DesktopLocation:
- location = pathForDirectory(NSDesktopDirectory);
- break;
case DocumentsLocation:
location = pathForDirectory(NSDocumentDirectory);
break;
case FontsLocation:
- location = bundlePath() + QLatin1String("/.fonts");
+ location = pathForDirectory(NSDocumentDirectory) + QLatin1String("/.fonts");
break;
case ApplicationsLocation:
- location = pathForDirectory(NSApplicationDirectory);
+ // NSApplicationDirectory points to a non-existing write-protected path.
break;
case MusicLocation:
- location = pathForDirectory(NSMusicDirectory);
+ // NSMusicDirectory points to a non-existing write-protected path. Use sensible fallback.
+ location = pathForDirectory(NSDocumentDirectory) + QLatin1String("/Music");
break;
case MoviesLocation:
- location = pathForDirectory(NSMoviesDirectory);
+ // NSMoviesDirectory points to a non-existing write-protected path. Use sensible fallback.
+ location = pathForDirectory(NSDocumentDirectory) + QLatin1String("/Movies");
break;
case PicturesLocation:
- location = pathForDirectory(NSPicturesDirectory);
+ // NSPicturesDirectory points to a non-existing write-protected path. Use sensible fallback.
+ location = pathForDirectory(NSDocumentDirectory) + QLatin1String("/Pictures");
break;
case TempLocation:
location = QString::fromNSString(NSTemporaryDirectory());
break;
+ case DesktopLocation:
case HomeLocation:
location = bundlePath();
break;
@@ -99,20 +100,12 @@ QString QStandardPaths::writableLocation(StandardLocation type)
location = pathForDirectory(NSDocumentDirectory);
break;
case DownloadLocation:
- location = pathForDirectory(NSDownloadsDirectory);
- break;
- default:
+ // NSDownloadsDirectory points to a non-existing write-protected path.
+ location = pathForDirectory(NSDocumentDirectory) + QLatin1String("/Download");
break;
- }
-
- switch (type) {
case RuntimeLocation:
break;
default:
- // All other types must return something, so use the document directory
- // as a reasonable fall-back (which will always exist).
- if (location.isEmpty())
- location = pathForDirectory(NSDocumentDirectory);
break;
}