From 7e12119fe60d13f86061349bee5511efb87aacca Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 20 Jan 2016 15:20:49 +0100 Subject: [PATCH] sidemenu: fix accounts display --- Classes/SideMenuTableView.m | 7 ++++++- Classes/Utils/Log.m | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Classes/SideMenuTableView.m b/Classes/SideMenuTableView.m index 6495f93ac..c4a7dabfd 100644 --- a/Classes/SideMenuTableView.m +++ b/Classes/SideMenuTableView.m @@ -73,7 +73,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [[UITableViewCell alloc] init]; if (indexPath.section == 0) { - LinphoneProxyConfig *proxy = ms_list_nth_data(linphone_core_get_proxy_config_list(LC), (int)indexPath.row); + // do not display default account here, it is already in header view + int idx = linphone_core_get_default_proxy_config(LC) ? ms_list_index(linphone_core_get_proxy_config_list(LC), + linphone_core_get_default_proxy_config(LC)) + : 0; + LinphoneProxyConfig *proxy = ms_list_nth_data(linphone_core_get_proxy_config_list(LC), + (int)indexPath.row + (idx <= indexPath.row ? 1 : 0)); if (proxy) { cell.textLabel.text = [NSString stringWithUTF8String:linphone_proxy_config_get_identity(proxy)]; cell.imageView.image = [StatusBarView imageForState:linphone_proxy_config_get_state(proxy)]; diff --git a/Classes/Utils/Log.m b/Classes/Utils/Log.m index 00b371129..7892d4eae 100644 --- a/Classes/Utils/Log.m +++ b/Classes/Utils/Log.m @@ -55,9 +55,9 @@ linphone_core_enable_log_collection(enabled); linphone_core_enable_logs_with_cb(linphone_iphone_log_handler); if (level == 0) { - NSLog(@"I/%s/Disabling all logs", ORTP_LOG_DOMAIN); linphone_core_set_log_level(ORTP_FATAL); ortp_set_log_level("ios", ORTP_FATAL); + NSLog(@"I/%s/Disabling all logs", ORTP_LOG_DOMAIN); } else { NSLog(@"I/%s/Enabling %s logs", ORTP_LOG_DOMAIN, (enabled ? "all" : "application only")); linphone_core_set_log_level(level);