diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 60b6a3983..fdbdc782a 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -43,7 +43,38 @@ [[LinphoneManager instance] becomeActive]; } +- (void)registerDefaultsFromSettingsBundle { + // source: http://stackoverflow.com/questions/510216/ + NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"]; + if(!settingsBundle) { + NSLog(@"Could not find Settings.bundle"); + return; + } + + NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Root.plist"]]; + NSArray *preferences = [settings objectForKey:@"PreferenceSpecifiers"]; + + NSMutableDictionary *defaultsToRegister = [[NSMutableDictionary alloc] initWithCapacity:[preferences count]]; + for(NSDictionary *prefSpecification in preferences) { + NSString *key = [prefSpecification objectForKey:@"Key"]; + if(key) { + [defaultsToRegister setObject:[prefSpecification objectForKey:@"DefaultValue"] forKey:key]; + } + } + + [[NSUserDefaults standardUserDefaults] registerDefaults:defaultsToRegister]; + [defaultsToRegister release]; +} + - (void) loadDefaultSettings { + + // if this is the first launch after installing, we would like to load default settings values from Settings.bundle + NSObject *somePrefVal = [[NSUserDefaults standardUserDefaults] objectForKey:@"debugenable_preference"]; + if(!somePrefVal) { + // has no value, so defaults have not been loaded yet + [self registerDefaultsFromSettingsBundle]; + } + NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys: @"NO", @"enable_first_login_view_preference", // nil]; diff --git a/submodules/build/builder-iphone-os.mk b/submodules/build/builder-iphone-os.mk index 380d77b67..fa1d94d6f 100644 --- a/submodules/build/builder-iphone-os.mk +++ b/submodules/build/builder-iphone-os.mk @@ -193,7 +193,7 @@ build-libgsm: cd $(BUILDER_BUILD_DIR)/$(gsm_dir)\ && mkdir -p $(prefix)/include/gsm \ && host_alias=$(host) . $(BUILDER_SRC_DIR)/build/$(config_site) \ - && make CC="$${CC}" INSTALL_ROOT=$(prefix) GSM_INSTALL_INC=$(prefix)/include/gsm install + && make -j1 CC="$${CC}" INSTALL_ROOT=$(prefix) GSM_INSTALL_INC=$(prefix)/include/gsm install clean-libgsm: cd $(BUILDER_BUILD_DIR)/$(gsm_dir)\ diff --git a/submodules/tunnel b/submodules/tunnel index c17f2142d..35e72d0c3 160000 --- a/submodules/tunnel +++ b/submodules/tunnel @@ -1 +1 @@ -Subproject commit c17f2142dadfba0f7f0bc5a92c680c845b56686a +Subproject commit 35e72d0c3a383da8865fbf37e5e13b6cfd9483fd