summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstandardpaths_ios.mm
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-03 10:23:56 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-03 10:23:56 +0200
commite2f66f921594b7be4af4a058c959557489e86879 (patch)
treecc44931708b57bd5a761906797c7dee0360d1d6b /src/corelib/io/qstandardpaths_ios.mm
parent933bf178aab88ab5df8a68cbf02611d6d8744b1b (diff)
parent754efa57d89c62d1796e01b407e9222e67450f52 (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
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;
}