From 1f069c52d4726bc0e23fa0fae21bc7cd87649e63 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 26 Oct 2011 21:31:05 +0200 Subject: [PATCH] fix default settings --- Classes/LinphoneAppDelegate.m | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 53f1fb272..8540af860 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -51,12 +51,16 @@ return; } - NSMutableDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Root.plist"]]; - [settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"audio.plist"]]]; - [settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"video.plist"]]]; - NSArray *preferences = [settings objectForKey:@"PreferenceSpecifiers"]; - + NSMutableDictionary *rootSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Root.plist"]]; + NSMutableDictionary *audioSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"audio.plist"]]; + NSMutableDictionary *videoSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"video.plist"]]; + + NSMutableArray *preferences = [rootSettings objectForKey:@"PreferenceSpecifiers"]; + [preferences addObjectsFromArray:[audioSettings objectForKey:@"PreferenceSpecifiers"]]; + [preferences addObjectsFromArray:[videoSettings objectForKey:@"PreferenceSpecifiers"]]; + NSMutableDictionary *defaultsToRegister = [[NSMutableDictionary alloc] initWithCapacity:[preferences count]]; + for(NSDictionary *prefSpecification in preferences) { NSString *key = [prefSpecification objectForKey:@"Key"]; if(key && [prefSpecification objectForKey:@"DefaultValue"]) { @@ -69,7 +73,8 @@ #ifdef HAVE_AMR @"YES",@"amr_8k_preference", // enable amr by default if compiled with #endif - //@"+33",@"countrycode_preference", + @"NO",@"debugenable_preference", + //@"+33",@"countrycode_preference", nil]; [defaultsToRegister addEntriesFromDictionary:appDefaults];