From 9633d4ccb8dd883e19c03c301e10d2fd492764d5 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 27 Mar 2012 09:32:30 +0200 Subject: [PATCH] Code cleanup --- Classes/LinphoneAppDelegate.m | 6 ++++-- Classes/LinphoneUI/LinphoneManager.m | 17 +++-------------- submodules/linphone | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index c397dc18f..fbb0524fb 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -220,13 +220,15 @@ int __aeabi_idiv(int a, int b) { @"YES",@"g729_preference", // enable amr by default if compiled with #endif //@"+33",@"countrycode_preference", - nil]; + nil]; + + [self loadDefaultSettings: appDefaults]; /* explicitely instanciate LinphoneManager */ LinphoneManager* lm = [[LinphoneManager alloc] init]; assert(lm == [LinphoneManager instance]); - [self loadDefaultSettings: appDefaults]; + [self setupUI]; diff --git a/Classes/LinphoneUI/LinphoneManager.m b/Classes/LinphoneUI/LinphoneManager.m index cc9f0841e..30a3a526f 100644 --- a/Classes/LinphoneUI/LinphoneManager.m +++ b/Classes/LinphoneUI/LinphoneManager.m @@ -71,17 +71,6 @@ extern void libmsbcg729_init(); return theLinphoneManager; } --(NSString*) appendCountryCodeIfPossible:(NSString*) number { - if (![number hasPrefix:@"+"] && ![number hasPrefix:@"00"]) { - NSString* lCountryCode = [[NSUserDefaults standardUserDefaults] stringForKey:@"countrycode_preference"]; - if (lCountryCode && [lCountryCode length]>0) { - //append country code - return [lCountryCode stringByAppendingString:number]; - } - } - return number; -} - -(NSString*) getDisplayNameFromAddressBook:(NSString*) number andUpdateCallLog:(LinphoneCallLog*)log { //1 normalize NSString* lNormalizedNumber = [FastAddressBook normalizePhoneNumber:number]; @@ -342,7 +331,7 @@ static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall* call, Lin } -(void) onRegister:(LinphoneCore *)lc cfg:(LinphoneProxyConfig*) cfg state:(LinphoneRegistrationState) state message:(const char*) message { - NSLog(@"NEW REGISTRATION STATE: '%s' (message: '%s')", linphone_registration_state_to_string(state), message); + ms_warning("NEW REGISTRATION STATE: '%s' (message: '%s')", linphone_registration_state_to_string(state), message); LinphoneAddress* lAddress = linphone_address_new(linphone_proxy_config_get_identity(cfg)); NSString* lUserName = linphone_address_get_username(lAddress)? [[NSString alloc] initWithUTF8String:linphone_address_get_username(lAddress) ]:@""; @@ -483,7 +472,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach -(BOOL) reconfigureLinphoneIfNeeded:(NSDictionary *)settings { if (theLinphoneCore==nil) { - ms_warning("cannot configure linphone beacause not initialized yet"); + ms_warning("cannot configure linphone because not initialized yet"); return NO; } @@ -553,7 +542,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach transportValue.tcp_port=0; transportValue.udp_port=0; } else { - ms_error("unexpected trasnport [%s]",[transport cStringUsingEncoding:[NSString defaultCStringEncoding]]); + ms_error("unexpected transport [%s]",[transport cStringUsingEncoding:[NSString defaultCStringEncoding]]); } if (linphone_core_set_sip_transports(theLinphoneCore, &transportValue)) { ms_error("cannot set transport"); diff --git a/submodules/linphone b/submodules/linphone index 8ffeb3eb7..83b2a2875 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 8ffeb3eb7c7e5738883f6c247330316753bf173e +Subproject commit 83b2a28753afd37e10fa3e863758170c034a24b3