Browse files

Mac GUI: if no cache path is registered, use a tmp.

  • Loading branch information...
1 parent 9e7942a commit be821e7d864c26ec1acd194242e4f94bd6c6da50 @bradallred bradallred committed Apr 29, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 apple/CocoaWrapper/mac/CocoaWrapper.mm
View
10 apple/CocoaWrapper/mac/CocoaWrapper.mm
@@ -86,7 +86,15 @@ - (void)applicationWillFinishLaunching:(NSNotification *) __unused aNotification
AddLogger(createAppleLogger());
// Load default defaults
- [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"defaults" ofType:@"plist"]]];
+ NSString* defaultsPath = [[NSBundle mainBundle] pathForResource:@"defaults" ofType:@"plist"];
+ NSDictionary* defaultDict = [NSDictionary dictionaryWithContentsOfFile:defaultsPath];
+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
+ [defaults registerDefaults:defaultDict];
+
+ if (![defaults stringForKey:@"CachePath"]) {
+ NSString* cachePath = [NSString stringWithFormat:@"%@gemrb", NSTemporaryDirectory()];
+ [defaults setValue:cachePath forKey:@"CachePath"];
+ }
}
/* Called when the internal event loop has just started running */

0 comments on commit be821e7

Please sign in to comment.