From 588577bd96c19cc9221d636a4ac2fec6d2b7f001 Mon Sep 17 00:00:00 2001 From: Randall Luecke Date: Mon, 27 Sep 2010 22:38:32 -0400 Subject: [PATCH] try to use setLocalStorageDatabasePath or use _setLocalStorageDatabasePath if not Conflicts: Tools/NativeHost/AppController.m --- Tools/NativeHost/AppController.m | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Tools/NativeHost/AppController.m b/Tools/NativeHost/AppController.m index 4982fc619..fa64a749d 100644 --- a/Tools/NativeHost/AppController.m +++ b/Tools/NativeHost/AppController.m @@ -178,15 +178,18 @@ NSString *SERVER_USER = nil; - (void)configureLocalStorage { - WebPreferences *webConfiguration = [WebPreferences standardPreferences]; - NSBundle *mainBundle = [NSBundle mainBundle]; - NSString *saveFolder = [mainBundle objectForInfoDictionaryKey:@"CPBundleName"]; - NSString *applicationSupportFile = [@"~/Library/Application Support/" stringByExpandingTildeInPath]; - NSString *savePath = [NSString pathWithComponents:[NSArray arrayWithObjects:applicationSupportFile, saveFolder, nil]]; - NSLog(savePath); - [webConfiguration _setLocalStorageDatabasePath:savePath]; - - [webView setPreferences:webConfiguration]; + WebPreferences *webConfiguration = [WebPreferences standardPreferences]; + NSBundle *mainBundle = [NSBundle mainBundle]; + NSString *cappBundleName = [mainBundle objectForInfoDictionaryKey:@"CPBundleName"]; + NSString *applicationSupportFile = [@"~/Library/Application Support/" stringByExpandingTildeInPath]; + NSString *savePath = [NSString pathWithComponents:[NSArray arrayWithObjects:applicationSupportFile, cappBundleName, @"LocalStorage", nil]]; + + if ([webConfiguration respondsToSelector:@selector(setLocalStorageDatabasePath:)]) + [webConfiguration setLocalStorageDatabasePath:savePath]; + else + [webConfiguration _setLocalStorageDatabasePath:savePath]; + + [webView setPreferences:webConfiguration]; } - (void)awakeFromNib