summaryrefslogtreecommitdiff
path: root/common/ios.mm
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-09-26 16:10:39 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-09-26 16:10:39 +0200
commitb9628c86543ffe819b030c3d84f65fa09e084850 (patch)
treee98e154b307a6a2b9eaa88c40d9c7fff8702e308 /common/ios.mm
parent1209744b38da0252731812d4cc5371be960fb3c3 (diff)
downloadqtlocation-mapboxgl-b9628c86543ffe819b030c3d84f65fa09e084850.tar.gz
add etag support and if-none-match/if-modified-since to cocoa http handling
Diffstat (limited to 'common/ios.mm')
-rw-r--r--common/ios.mm8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/ios.mm b/common/ios.mm
index 1076343e24..7989e73a4e 100644
--- a/common/ios.mm
+++ b/common/ios.mm
@@ -8,12 +8,14 @@ namespace platform {
// Returns the path to the default cache database on this system.
std::string defaultCacheDatabase() {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
+ if ([paths count] == 0) {
+ // Disable the cache if we don't have a location to write.
+ return "";
+ }
+
NSString *libraryDirectory = [paths objectAtIndex:0];
return [[libraryDirectory stringByAppendingPathComponent:@"cache.db"] UTF8String];
}
}
}
-
-
-// Returns the path to the default cache database on this system.