avidyalalala / sunpinyin

Automatically exported from code.google.com/p/sunpinyin
0 stars 0 forks source link

sunpinyin should save its user data files under ~/Library/Application\ Support/SunPinyin/ #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
sunpinyin should save its user data files under ~/Library/Application\ 
Support/SunPinyin/

Original issue reported on code.google.com by find...@gmail.com on 17 Mar 2010 at 1:31

GoogleCodeExporter commented 9 years ago
should not save user's data files under ~/.sunpinyin, 

diff --git a/wrapper/macos/SunPinyinApplicationDelegate.mm 
b/wrapper/macos/SunPinyinApplicationDelegate.mm
index 78fa308..ba41251 100644
--- a/wrapper/macos/SunPinyinApplicationDelegate.mm
+++ b/wrapper/macos/SunPinyinApplicationDelegate.mm
@@ -139,6 +139,14 @@ void updateKeyProfileSettings(NSUserDefaults* pref);

     string res_path = [[[NSBundle mainBundle] resourcePath] UTF8String];
     AOptionEventBus::instance().publishEvent(COptionEvent(SYSTEM_DATA_DIR, 
res_path));
+
+    NSArray *paths = 
NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, 
NSUserDomainMask, YES);
+    if ([paths count]) 
+    {
+        string user_data_dir = [[paths objectAtIndex: 0] UTF8String];
+        user_data_dir.append ("/SunPinyin");
+        AOptionEventBus::instance().publishEvent(COptionEvent(USER_DATA_DIR, 
user_data_dir));
+    }
 }

Original comment by find...@gmail.com on 17 Mar 2010 at 1:34