From abb5f582ee81f498c1165d869987a2c1e702d088 Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Fri, 23 Mar 2012 15:43:16 -0400
Subject: [PATCH]  * #9490: removed resolve_once parameter that was causing a
 segfault

---
 daemon/src/account.h                          |   1 -
 gnome/src/accountlist.c                       |  15 +-
 gnome/src/accountlist.h                       |   4 +-
 gnome/src/config/accountconfigdialog.c        | 251 ++++++++----------
 gnome/src/config/accountconfigdialog.h        |   2 +-
 gnome/src/config/accountlistconfigdialog.c    |  23 +-
 gnome/src/config/audioconf.c                  |  20 +-
 gnome/src/config/audioconf.h                  |   2 +-
 .../dbus/configurationmanager-introspec.xml   |   1 -
 gnome/src/dbus/dbus.c                         |   3 +-
 gnome/src/dbus/dbus.h                         |   2 +-
 gnome/src/sflphone_const.h                    |  93 ++++---
 gnome/src/str_utils.c                         |   2 +
 13 files changed, 208 insertions(+), 211 deletions(-)

diff --git a/daemon/src/account.h b/daemon/src/account.h
index 1c46c08be0..0a3577d20d 100644
--- a/daemon/src/account.h
+++ b/daemon/src/account.h
@@ -71,7 +71,6 @@ static const char *const CONFIG_ACCOUNT_TYPE                 = "Account.type";
 static const char *const CONFIG_ACCOUNT_ALIAS                = "Account.alias";
 static const char *const CONFIG_ACCOUNT_MAILBOX	             = "Account.mailbox";
 static const char *const CONFIG_ACCOUNT_ENABLE               = "Account.enable";
-static const char *const CONFIG_ACCOUNT_RESOLVE_ONCE         = "Account.resolveOnce";
 static const char *const CONFIG_ACCOUNT_REGISTRATION_EXPIRE  = "Account.registrationExpire";
 static const char *const CONFIG_CREDENTIAL_NUMBER            = "Credential.count";
 static const char *const CONFIG_ACCOUNT_DTMF_TYPE            = "Account.dtmfType";
diff --git a/gnome/src/accountlist.c b/gnome/src/accountlist.c
index add45f4501..6d8423219e 100644
--- a/gnome/src/accountlist.c
+++ b/gnome/src/accountlist.c
@@ -294,8 +294,9 @@ gboolean current_account_has_new_message(void)
     return current && current->_messages_number > 0;
 }
 
-gboolean is_IP2IP(account_t *account)
+gboolean is_IP2IP(const account_t *account)
 {
+    g_assert(account);
     return utf8_case_cmp(account->accountID, IP2IP) == 0;
 }
 
@@ -308,3 +309,15 @@ account_t *create_default_account()
     sflphone_fill_codec_list_per_account(account);
     return account;
 }
+
+void initialize_credential_information(account_t *account)
+{
+    if (!account->credential_information) {
+        account->credential_information = g_ptr_array_sized_new(1);
+        GHashTable * new_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+        g_hash_table_insert(new_table, g_strdup(ACCOUNT_REALM), g_strdup("*"));
+        g_hash_table_insert(new_table, g_strdup(ACCOUNT_USERNAME), g_strdup(""));
+        g_hash_table_insert(new_table, g_strdup(ACCOUNT_PASSWORD), g_strdup(""));
+        g_ptr_array_add(account->credential_information, new_table);
+    }
+}
diff --git a/gnome/src/accountlist.h b/gnome/src/accountlist.h
index c892c408b0..57df391081 100644
--- a/gnome/src/accountlist.h
+++ b/gnome/src/accountlist.h
@@ -183,8 +183,10 @@ void current_account_set_message_number (guint nb);
 
 gboolean current_account_has_new_message (void);
 
-gboolean is_IP2IP(account_t *account);
+gboolean is_IP2IP(const account_t *account);
 
 account_t *create_default_account();
 
+void initialize_credential_information(account_t *account);
+
 #endif
diff --git a/gnome/src/config/accountconfigdialog.c b/gnome/src/config/accountconfigdialog.c
index eec66397cb..c284e73712 100644
--- a/gnome/src/config/accountconfigdialog.c
+++ b/gnome/src/config/accountconfigdialog.c
@@ -67,7 +67,6 @@ static GtkWidget *entry_hostname;
 static GtkWidget *entry_password;
 static GtkWidget *entry_mailbox;
 static GtkWidget *entry_user_agent;
-static GtkWidget *entry_resolve_name_only_once;
 static GtkWidget *expire_spin_box;
 static GtkListStore *credential_store;
 static GtkWidget *delete_cred_button;
@@ -80,7 +79,7 @@ static GtkWidget *published_address_entry;
 static GtkWidget *local_address_combo;
 static GtkWidget *use_stun_check_box;
 static GtkWidget *same_as_local_radio_button;
-static GtkWidget *publishedAddrRadioButton;
+static GtkWidget *published_addr_radio_button;
 static GtkWidget *published_port_spin_box;
 static GtkWidget *local_port_spin_box;
 static GtkWidget *published_address_label;
@@ -126,7 +125,7 @@ static void show_password_cb(GtkWidget *widget UNUSED, gpointer data)
 }
 
 /* Signal to protocol_combo 'changed' */
-void change_protocol_cb(account_t *account UNUSED)
+void change_protocol_cb()
 {
     gchar *protocol = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(protocol_combo));
 
@@ -196,7 +195,7 @@ static void update_credential_cb(GtkWidget *widget, gpointer data UNUSED)
     }
 }
 
-static GtkWidget* create_basic_tab(account_t *account)
+static GtkWidget* create_basic_tab(const account_t *account)
 {
     g_assert(account);
 
@@ -271,7 +270,7 @@ static GtkWidget* create_basic_tab(account_t *account)
 
     /* Link signal 'changed' */
     g_signal_connect(G_OBJECT(GTK_COMBO_BOX(protocol_combo)), "changed",
-                     G_CALLBACK(change_protocol_cb), account);
+                     G_CALLBACK(change_protocol_cb), NULL);
 
     row++;
     label = gtk_label_new_with_mnemonic(_("_Host name"));
@@ -372,20 +371,11 @@ static GtkWidget* create_basic_tab(account_t *account)
     return frame;
 }
 
-static void fill_treeview_with_credential(account_t * account)
+static void fill_treeview_with_credential(const account_t * account)
 {
     GtkTreeIter iter;
     gtk_list_store_clear(credential_store);
 
-    if (!account->credential_information) {
-        account->credential_information = g_ptr_array_sized_new(1);
-        GHashTable * new_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
-        g_hash_table_insert(new_table, g_strdup(ACCOUNT_REALM), g_strdup("*"));
-        g_hash_table_insert(new_table, g_strdup(ACCOUNT_USERNAME), g_strdup(""));
-        g_hash_table_insert(new_table, g_strdup(ACCOUNT_PASSWORD), g_strdup(""));
-        g_ptr_array_add(account->credential_information, new_table);
-    }
-
     for (unsigned i = 0; i < account->credential_information->len; i++) {
         GHashTable * element = g_ptr_array_index(account->credential_information, i);
         gtk_list_store_append(credential_store, &iter);
@@ -512,7 +502,7 @@ static void use_sip_tls_cb(GtkWidget *widget, gpointer data)
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_stun_check_box), FALSE);
         gtk_widget_set_sensitive(use_stun_check_box, FALSE);
         gtk_widget_set_sensitive(same_as_local_radio_button, TRUE);
-        gtk_widget_set_sensitive(publishedAddrRadioButton, TRUE);
+        gtk_widget_set_sensitive(published_addr_radio_button, TRUE);
         gtk_widget_hide(stun_server_label);
         gtk_widget_hide(stun_server_entry);
 
@@ -528,7 +518,7 @@ static void use_sip_tls_cb(GtkWidget *widget, gpointer data)
 
         if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(use_stun_check_box))) {
             gtk_widget_set_sensitive(same_as_local_radio_button, FALSE);
-            gtk_widget_set_sensitive(publishedAddrRadioButton, FALSE);
+            gtk_widget_set_sensitive(published_addr_radio_button, FALSE);
             gtk_widget_show(stun_server_label);
             gtk_widget_show(stun_server_entry);
             gtk_widget_hide(published_address_entry);
@@ -537,7 +527,7 @@ static void use_sip_tls_cb(GtkWidget *widget, gpointer data)
             gtk_widget_hide(published_port_label);
         } else {
             gtk_widget_set_sensitive(same_as_local_radio_button, TRUE);
-            gtk_widget_set_sensitive(publishedAddrRadioButton, TRUE);
+            gtk_widget_set_sensitive(published_addr_radio_button, TRUE);
             gtk_widget_hide(stun_server_label);
             gtk_widget_hide(stun_server_entry);
         }
@@ -614,7 +604,7 @@ static void use_stun_cb(GtkWidget *widget, gpointer data UNUSED)
         gtk_widget_show(stun_server_label);
         gtk_widget_show(stun_server_entry);
         gtk_widget_set_sensitive(same_as_local_radio_button, FALSE);
-        gtk_widget_set_sensitive(publishedAddrRadioButton, FALSE);
+        gtk_widget_set_sensitive(published_addr_radio_button, FALSE);
 
         gtk_widget_hide(published_address_label);
         gtk_widget_hide(published_port_label);
@@ -625,9 +615,9 @@ static void use_stun_cb(GtkWidget *widget, gpointer data UNUSED)
         gtk_widget_hide(stun_server_label);
         gtk_widget_hide(stun_server_entry);
         gtk_widget_set_sensitive(same_as_local_radio_button, TRUE);
-        gtk_widget_set_sensitive(publishedAddrRadioButton, TRUE);
+        gtk_widget_set_sensitive(published_addr_radio_button, TRUE);
 
-        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(publishedAddrRadioButton))) {
+        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(published_addr_radio_button))) {
             gtk_widget_show(published_address_label);
             gtk_widget_show(published_port_label);
             gtk_widget_show(published_address_entry);
@@ -655,20 +645,15 @@ static void same_as_local_cb(GtkWidget * widget, gpointer data UNUSED)
 
 
 
-GtkWidget* create_credential_widget(account_t *a)
+static GtkWidget* create_credential_widget(const account_t *account)
 {
-
-    GtkWidget *frame, *table, *scrolled_window_credential, *addButton;
-    GtkCellRenderer * renderer;
-    GtkTreeViewColumn * tree_view_column;
-    GtkTreeSelection * treeSelection;
-
     /* Credentials tree view */
+    GtkWidget *frame, *table;
     gnome_main_section_new_with_table(_("Credential"), &frame, &table, 1, 1);
     gtk_container_set_border_width(GTK_CONTAINER(table), 10);
     gtk_table_set_row_spacings(GTK_TABLE(table), 10);
 
-    scrolled_window_credential = gtk_scrolled_window_new(NULL, NULL);
+    GtkWidget *scrolled_window_credential = gtk_scrolled_window_new(NULL, NULL);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window_credential), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
     gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window_credential), GTK_SHADOW_IN);
     gtk_table_attach_defaults(GTK_TABLE(table), scrolled_window_credential, 0, 1, 0, 1);
@@ -681,17 +666,15 @@ GtkWidget* create_credential_widget(account_t *a)
                                         );
 
     treeview_credential = gtk_tree_view_new_with_model(GTK_TREE_MODEL(credential_store));
-    treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview_credential));
-    g_signal_connect(G_OBJECT(treeSelection), "changed", G_CALLBACK(select_credential_cb), credential_store);
+    GtkTreeSelection * tree_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview_credential));
+    g_signal_connect(G_OBJECT(tree_selection), "changed", G_CALLBACK(select_credential_cb), credential_store);
 
-    renderer = gtk_cell_renderer_text_new();
+    GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
     g_object_set(renderer, "editable", TRUE, "editable-set", TRUE, NULL);
     g_signal_connect(G_OBJECT(renderer), "edited", G_CALLBACK(cell_edited_cb), credential_store);
     g_object_set_data(G_OBJECT(renderer), "column", GINT_TO_POINTER(COLUMN_CREDENTIAL_REALM));
-    tree_view_column = gtk_tree_view_column_new_with_attributes("Realm",
-                     renderer,
-                     "markup", COLUMN_CREDENTIAL_REALM,
-                     NULL);
+
+    GtkTreeViewColumn *tree_view_column = gtk_tree_view_column_new_with_attributes("Realm", renderer, "markup", COLUMN_CREDENTIAL_REALM, NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(treeview_credential), tree_view_column);
 
     renderer = gtk_cell_renderer_text_new();
@@ -715,13 +698,13 @@ GtkWidget* create_credential_widget(account_t *a)
 
     gtk_container_add(GTK_CONTAINER(scrolled_window_credential), treeview_credential);
 
-    fill_treeview_with_credential(a);
+    fill_treeview_with_credential(account);
 
     /* Credential Buttons */
     GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
     gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 3, 1, 2);
 
-    addButton = gtk_button_new_from_stock(GTK_STOCK_ADD);
+    GtkWidget *addButton = gtk_button_new_from_stock(GTK_STOCK_ADD);
     g_signal_connect(addButton, "clicked", G_CALLBACK(add_credential_cb), credential_store);
     gtk_box_pack_start(GTK_BOX(hbox), addButton, FALSE, FALSE, 0);
 
@@ -736,47 +719,52 @@ GtkWidget* create_credential_widget(account_t *a)
 }
 
 
-GtkWidget* create_security_widget(account_t *a)
+static GtkWidget*
+create_security_widget(const account_t *account)
 {
-    GtkWidget *frame, *table, *sip_tls_advanced_button, *label;
-    gchar *curSRTPEnabled = NULL, *curKeyExchange = NULL, *curTLSEnabled = NULL;
+    gchar *curSRTPEnabled = NULL, *curKeyExchange = NULL,
+          *curTLSEnabled = NULL;
 
     // Load from SIP/IAX/Unknown ?
-    if (a) {
-        curKeyExchange = g_hash_table_lookup(a->properties, ACCOUNT_KEY_EXCHANGE);
-
+    if (account && account->properties) {
+        curKeyExchange = g_hash_table_lookup(account->properties,
+                                             ACCOUNT_KEY_EXCHANGE);
         if (curKeyExchange == NULL)
             curKeyExchange = "none";
 
-        curSRTPEnabled = g_hash_table_lookup(a->properties, ACCOUNT_SRTP_ENABLED);
+        curSRTPEnabled = g_hash_table_lookup(account->properties, ACCOUNT_SRTP_ENABLED);
 
         if (curSRTPEnabled == NULL)
             curSRTPEnabled = "false";
 
-        curTLSEnabled = g_hash_table_lookup(a->properties, TLS_ENABLE);
+        curTLSEnabled = g_hash_table_lookup(account->properties, TLS_ENABLE);
 
         if (curTLSEnabled == NULL)
             curTLSEnabled = "false";
     }
 
+    GtkWidget *frame, *table;
     gnome_main_section_new_with_table(_("Security"), &frame, &table, 2, 3);
     gtk_container_set_border_width(GTK_CONTAINER(table), 10);
     gtk_table_set_row_spacings(GTK_TABLE(table), 10);
     gtk_table_set_col_spacings(GTK_TABLE(table), 10);
 
     /* TLS subsection */
-    sip_tls_advanced_button = gtk_button_new_from_stock(GTK_STOCK_EDIT);
+    GtkWidget *sip_tls_advanced_button = gtk_button_new_from_stock(GTK_STOCK_EDIT);
     gtk_table_attach_defaults(GTK_TABLE(table), sip_tls_advanced_button, 2, 3, 0, 1);
     gtk_widget_set_sensitive(sip_tls_advanced_button, FALSE);
-    g_signal_connect(G_OBJECT(sip_tls_advanced_button), "clicked", G_CALLBACK(show_advanced_tls_options_cb),a->properties);
+    g_signal_connect(G_OBJECT(sip_tls_advanced_button), "clicked",
+                     G_CALLBACK(show_advanced_tls_options_cb),
+                     (gpointer) account->properties);
 
     use_sip_tls_check_box = gtk_check_button_new_with_mnemonic(_("Use TLS transport(sips)"));
     g_signal_connect(use_sip_tls_check_box, "toggled", G_CALLBACK(use_sip_tls_cb), sip_tls_advanced_button);
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_sip_tls_check_box),(g_strcmp0(curTLSEnabled, "true") == 0) ? TRUE:FALSE);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_sip_tls_check_box),
+                                 g_strcmp0(curTLSEnabled, "true") == 0);
     gtk_table_attach_defaults(GTK_TABLE(table), use_sip_tls_check_box, 0, 2, 0, 1);
 
     /* ZRTP subsection */
-    label = gtk_label_new_with_mnemonic(_("SRTP key exchange"));
+    GtkWidget *label = gtk_label_new_with_mnemonic(_("SRTP key exchange"));
     gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
     key_exchange_combo = gtk_combo_box_text_new();
     gtk_label_set_mnemonic_widget(GTK_LABEL(label), key_exchange_combo);
@@ -785,7 +773,9 @@ GtkWidget* create_security_widget(account_t *a)
     gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(key_exchange_combo), _("Disabled"));
 
     zrtp_button = gtk_button_new_from_stock(GTK_STOCK_PREFERENCES);
-    g_signal_connect(G_OBJECT(zrtp_button), "clicked", G_CALLBACK(show_advanced_zrtp_options_cb),a->properties);
+    g_signal_connect(G_OBJECT(zrtp_button), "clicked",
+                     G_CALLBACK(show_advanced_zrtp_options_cb),
+                     account->properties);
 
     if (g_strcmp0(curSRTPEnabled, "false") == 0) {
         gtk_combo_box_set_active(GTK_COMBO_BOX(key_exchange_combo), 2);
@@ -801,7 +791,8 @@ GtkWidget* create_security_widget(account_t *a)
         }
     }
 
-    g_signal_connect(G_OBJECT(GTK_COMBO_BOX(key_exchange_combo)), "changed", G_CALLBACK(key_exchange_changed_cb), a);
+    g_signal_connect(G_OBJECT(GTK_COMBO_BOX(key_exchange_combo)), "changed",
+                     G_CALLBACK(key_exchange_changed_cb), NULL);
 
     gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
     gtk_table_attach_defaults(GTK_TABLE(table), key_exchange_combo, 1, 2, 1, 2);
@@ -813,20 +804,17 @@ GtkWidget* create_security_widget(account_t *a)
 }
 
 
-GtkWidget * create_security_tab(account_t *a)
+static GtkWidget * create_security_tab(const account_t *account)
 {
-    GtkWidget * frame;
-    GtkWidget * ret;
-
-    ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
+    GtkWidget * ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
     gtk_container_set_border_width(GTK_CONTAINER(ret), 10);
 
     // Credentials frame
-    frame = create_credential_widget(a);
+    GtkWidget * frame = create_credential_widget(account);
     gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
 
     // Security frame
-    frame = create_security_widget(a);
+    frame = create_security_widget(account);
     gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
 
     gtk_widget_show_all(ret);
@@ -834,31 +822,22 @@ GtkWidget * create_security_tab(account_t *a)
     return ret;
 }
 
-static GtkWidget* create_registration_expire(account_t *a)
+static GtkWidget* create_registration_expire(const account_t *account)
 {
-
-    GtkWidget *table, *frame, *label;
-
-    gchar *resolve_once=NULL, *account_expire=NULL;
-    gchar *orig_key = NULL;
-    if (a) {
-        gboolean gotkey = FALSE;
-        gotkey = g_hash_table_lookup_extended(a->properties, ACCOUNT_RESOLVE_ONCE, (gpointer)&orig_key, (gpointer)&resolve_once);
-        if(gotkey == FALSE) {
-            ERROR("could not retreive resolve_once from account properties");
-        } 
-        gotkey = g_hash_table_lookup_extended(a->properties, ACCOUNT_REGISTRATION_EXPIRE, (gpointer)&orig_key, (gpointer)&account_expire);
-        if(gotkey == FALSE) {
-            ERROR("could not retreive %s from account properties", ACCOUNT_REGISTRATION_EXPIRE);
-        }
-    }
+    gchar *account_expire = NULL;
+    void *orig_key = NULL;
+    if (account && account->properties)
+        if (!g_hash_table_lookup_extended(account->properties, ACCOUNT_REGISTRATION_EXPIRE,
+                                          &orig_key, (gpointer) &account_expire))
+            ERROR("Could not retrieve %s from account properties",
+                  ACCOUNT_REGISTRATION_EXPIRE);
     
-
+    GtkWidget *table, *frame;
     gnome_main_section_new_with_table(_("Registration"), &frame, &table, 2, 3);
     gtk_container_set_border_width(GTK_CONTAINER(table), 10);
     gtk_table_set_row_spacings(GTK_TABLE(table), 5);
 
-    label = gtk_label_new_with_mnemonic(_("Registration expire"));
+    GtkWidget *label = gtk_label_new_with_mnemonic(_("Registration expire"));
     gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
     gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
     expire_spin_box = gtk_spin_button_new_with_range(1, 65535, 1);
@@ -866,38 +845,32 @@ static GtkWidget* create_registration_expire(account_t *a)
     gtk_spin_button_set_value(GTK_SPIN_BUTTON(expire_spin_box), g_ascii_strtod(account_expire, NULL));
     gtk_table_attach_defaults(GTK_TABLE(table), expire_spin_box, 1, 2, 0, 1);
 
-    entry_resolve_name_only_once = gtk_check_button_new_with_mnemonic(_("_Comply with RFC 3263"));
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(entry_resolve_name_only_once),
-                                 utf8_case_cmp(resolve_once,"false") == 0 ? TRUE: FALSE);
-    gtk_table_attach_defaults(GTK_TABLE(table), entry_resolve_name_only_once, 0, 2, 1, 2);
-    gtk_widget_set_sensitive(entry_resolve_name_only_once , TRUE);
-
     return frame;
 }
 
-GtkWidget* create_network(account_t *a)
+static GtkWidget*
+create_network(const account_t *account)
 {
-    GtkWidget *table, *frame, *label;
     gchar *local_interface = NULL;
     gchar *local_port = NULL;
 
-    if (a) {
-        local_interface = g_hash_table_lookup(a->properties, LOCAL_INTERFACE);
-        local_port = g_hash_table_lookup(a->properties, LOCAL_PORT);
+    if (account) {
+        local_interface = g_hash_table_lookup(account->properties, LOCAL_INTERFACE);
+        local_port = g_hash_table_lookup(account->properties, LOCAL_PORT);
     }
 
+    GtkWidget *table, *frame;
     gnome_main_section_new_with_table(_("Network Interface"), &frame, &table, 2, 3);
     gtk_container_set_border_width(GTK_CONTAINER(table), 10);
     gtk_table_set_row_spacings(GTK_TABLE(table), 5);
 
     /**
-     * Retreive the list of IP interface from the
+     * Retrieve the list of IP interface from the
      * the daemon and build the combo box.
      */
     local_address_combo = gtk_combo_box_text_new();
 
-
-    label = gtk_label_new_with_mnemonic(_("Local address"));
+    GtkWidget *label = gtk_label_new_with_mnemonic(_("Local address"));
     gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
     gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 
@@ -905,7 +878,6 @@ GtkWidget* create_network(account_t *a)
 
     int idx = 0;
     for (gchar **iface = iface_list; iface && *iface; iface++, idx++) {
-
         gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(local_address_combo), NULL, *iface);
         if (g_strcmp0(*iface, local_interface) == 0)
             gtk_combo_box_set_active(GTK_COMBO_BOX(local_address_combo), idx);
@@ -913,7 +885,6 @@ GtkWidget* create_network(account_t *a)
     if (!local_interface)
         gtk_combo_box_set_active(GTK_COMBO_BOX(local_address_combo), 0);
 
-
     gtk_label_set_mnemonic_widget(GTK_LABEL(label), local_address_combo);
     gtk_table_attach(GTK_TABLE(table), local_address_combo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
 
@@ -940,9 +911,8 @@ GtkWidget* create_network(account_t *a)
     return frame;
 }
 
-GtkWidget* create_published_address(account_t *a)
+GtkWidget* create_published_address(const account_t *account)
 {
-
     GtkWidget *table, *frame;
     gchar *use_tls =NULL;
     gchar *published_address = NULL;
@@ -952,22 +922,22 @@ GtkWidget* create_published_address(account_t *a)
     gchar *published_sameas_local = NULL;
 
     // Get the user configuration
-    if (a) {
+    if (account) {
 
-        use_tls = g_hash_table_lookup(a->properties, TLS_ENABLE);
-        published_sameas_local = g_hash_table_lookup(a->properties, PUBLISHED_SAMEAS_LOCAL);
+        use_tls = g_hash_table_lookup(account->properties, TLS_ENABLE);
+        published_sameas_local = g_hash_table_lookup(account->properties, PUBLISHED_SAMEAS_LOCAL);
 
         if (utf8_case_cmp(published_sameas_local, "true") == 0) {
-            published_address = dbus_get_address_from_interface_name(g_hash_table_lookup(a->properties, LOCAL_INTERFACE));
-            published_port = g_hash_table_lookup(a->properties, LOCAL_PORT);
+            published_address = dbus_get_address_from_interface_name(g_hash_table_lookup(account->properties, LOCAL_INTERFACE));
+            published_port = g_hash_table_lookup(account->properties, LOCAL_PORT);
         } else {
-            published_address = g_hash_table_lookup(a->properties, PUBLISHED_ADDRESS);
-            published_port = g_hash_table_lookup(a->properties, PUBLISHED_PORT);
+            published_address = g_hash_table_lookup(account->properties, PUBLISHED_ADDRESS);
+            published_port = g_hash_table_lookup(account->properties, PUBLISHED_PORT);
         }
 
-        stun_enable = g_hash_table_lookup(a->properties, ACCOUNT_SIP_STUN_ENABLED);
-        stun_server = g_hash_table_lookup(a->properties, ACCOUNT_SIP_STUN_SERVER);
-        published_sameas_local = g_hash_table_lookup(a->properties, PUBLISHED_SAMEAS_LOCAL);
+        stun_enable = g_hash_table_lookup(account->properties, ACCOUNT_SIP_STUN_ENABLED);
+        stun_server = g_hash_table_lookup(account->properties, ACCOUNT_SIP_STUN_SERVER);
+        published_sameas_local = g_hash_table_lookup(account->properties, PUBLISHED_SAMEAS_LOCAL);
     }
 
     gnome_main_section_new_with_table(_("Published address"), &frame, &table, 2, 3);
@@ -976,7 +946,7 @@ GtkWidget* create_published_address(account_t *a)
 
     use_stun_check_box = gtk_check_button_new_with_mnemonic(_("Using STUN"));
     gtk_table_attach_defaults(GTK_TABLE(table), use_stun_check_box, 0, 1, 0, 1);
-    g_signal_connect(use_stun_check_box, "toggled", G_CALLBACK(use_stun_cb), a);
+    g_signal_connect(use_stun_check_box, "toggled", G_CALLBACK(use_stun_cb), NULL);
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_stun_check_box),
                                  utf8_case_cmp(stun_enable, "true") == 0);
     gtk_widget_set_sensitive(use_stun_check_box, utf8_case_cmp(use_tls, "true") != 0);
@@ -992,15 +962,15 @@ GtkWidget* create_published_address(account_t *a)
     same_as_local_radio_button = gtk_radio_button_new_with_mnemonic_from_widget(NULL, _("Same as local parameters"));
     gtk_table_attach_defaults(GTK_TABLE(table), same_as_local_radio_button, 0, 2, 3, 4);
 
-    publishedAddrRadioButton = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(same_as_local_radio_button), _("Set published address and port:"));
-    gtk_table_attach_defaults(GTK_TABLE(table), publishedAddrRadioButton, 0, 2, 4, 5);
+    published_addr_radio_button = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(same_as_local_radio_button), _("Set published address and port:"));
+    gtk_table_attach_defaults(GTK_TABLE(table), published_addr_radio_button, 0, 2, 4, 5);
 
     if (utf8_case_cmp(published_sameas_local, "true") == 0) {
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(same_as_local_radio_button), TRUE);
-        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(publishedAddrRadioButton), FALSE);
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(published_addr_radio_button), FALSE);
     } else {
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(same_as_local_radio_button), FALSE);
-        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(publishedAddrRadioButton), TRUE);
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(published_addr_radio_button), TRUE);
     }
 
     published_address_label = gtk_label_new_with_mnemonic(_("Published address"));
@@ -1025,41 +995,37 @@ GtkWidget* create_published_address(account_t *a)
     // widgets need to be instanciated before that.
     g_signal_connect(local_address_combo, "changed", G_CALLBACK(local_interface_changed_cb), local_address_combo);
 
-
     g_signal_connect(same_as_local_radio_button, "toggled", G_CALLBACK(same_as_local_cb), same_as_local_radio_button);
-    g_signal_connect(publishedAddrRadioButton, "toggled", G_CALLBACK(set_published_addr_manually_cb), publishedAddrRadioButton);
+    g_signal_connect(published_addr_radio_button, "toggled", G_CALLBACK(set_published_addr_manually_cb), published_addr_radio_button);
 
-    set_published_addr_manually_cb(publishedAddrRadioButton, NULL);
+    set_published_addr_manually_cb(published_addr_radio_button, NULL);
 
     return frame;
 }
 
-GtkWidget* create_advanced_tab(account_t *a)
+GtkWidget* create_advanced_tab(const account_t *account)
 {
-
     // Build the advanced tab, to appear on the account configuration panel
     DEBUG("Config: Build advanced tab");
 
-    GtkWidget *vbox, *frame;
-
-    vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
+    GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
 
     gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
 
-    frame = create_registration_expire(a);
+    GtkWidget *frame = create_registration_expire(account);
     gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
-    frame = create_network(a);
+    frame = create_network(account);
     gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
-    frame = create_published_address(a);
+    frame = create_published_address(account);
     gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
     gtk_widget_show_all(vbox);
 
     use_stun_cb(use_stun_check_box, NULL);
 
-    set_published_addr_manually_cb(publishedAddrRadioButton, NULL);
+    set_published_addr_manually_cb(published_addr_radio_button, NULL);
 
     return vbox;
 }
@@ -1071,7 +1037,8 @@ static void ringtone_enabled_cb(GtkWidget *widget UNUSED, gpointer data, const g
 }
 
 
-static GtkWidget* create_audiocodecs_configuration(account_t *account)
+static GtkWidget*
+create_audiocodecs_configuration(const account_t *account)
 {
     GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
     gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
@@ -1144,7 +1111,7 @@ static GtkWidget* create_audiocodecs_configuration(account_t *account)
     return vbox;
 }
 
-GtkWidget* create_direct_ip_calls_tab(account_t *a)
+static GtkWidget* create_direct_ip_calls_tab(const account_t *account)
 {
     GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
     gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
@@ -1162,16 +1129,21 @@ GtkWidget* create_direct_ip_calls_tab(account_t *a)
     gtk_widget_set_size_request(label, 350, -1);
     gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
 
-    GtkWidget *frame = create_network(a);
+    GtkWidget *frame = create_network(account);
     gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
-    frame = create_security_widget(a);
+    frame = create_security_widget(account);
     gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
     gtk_widget_show_all(vbox);
     return vbox;
 }
 
+static gchar *bool_to_string(gboolean v)
+{
+    return v ? g_strdup("true") : g_strdup("false");
+}
+
 void show_account_window(account_t *account)
 {
     // First we reset
@@ -1216,13 +1188,13 @@ void show_account_window(account_t *account)
 
     // Do not need advanced or security one for the IP2IP account
     if (!is_IP2IP(account)) {
-
         /* Advanced */
         advanced_tab = create_advanced_tab(account);
         gtk_notebook_append_page(GTK_NOTEBOOK(notebook), advanced_tab, gtk_label_new(_("Advanced")));
         gtk_notebook_page_num(GTK_NOTEBOOK(notebook), advanced_tab);
 
         /* Security */
+        initialize_credential_information(account);
         security_tab = create_security_tab(account);
         gtk_notebook_append_page(GTK_NOTEBOOK(notebook), security_tab, gtk_label_new(_("Security")));
         gtk_notebook_page_num(GTK_NOTEBOOK(notebook), security_tab);
@@ -1237,14 +1209,13 @@ void show_account_window(account_t *account)
     if (protocol_combo)
         g_signal_emit_by_name(protocol_combo, "changed", NULL);
 
-    gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook),  0);
+    gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);
 
     /* Run dialog */
     gint response = gtk_dialog_run(GTK_DIALOG(dialog));
 
     // Update protocol in case it changed
     gchar *proto;
-
     if (protocol_combo)
         proto = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(protocol_combo));
     else
@@ -1281,10 +1252,6 @@ void show_account_window(account_t *account)
     if (g_strcmp0(proto, "SIP") == 0) {
         if (!is_IP2IP(account)) {
 
-            g_hash_table_replace(account->properties,
-                                 g_strdup(ACCOUNT_RESOLVE_ONCE),
-                                 g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entry_resolve_name_only_once)) ? "false" : "true"));
-
             g_hash_table_replace(account->properties,
                                  g_strdup(ACCOUNT_REGISTRATION_EXPIRE),
                                  g_strdup(gtk_entry_get_text(GTK_ENTRY(expire_spin_box))));
@@ -1293,18 +1260,20 @@ void show_account_window(account_t *account)
                                  g_strdup(ACCOUNT_ROUTE),
                                  g_strdup(gtk_entry_get_text(GTK_ENTRY(entry_route_set))));
 
-
             g_hash_table_replace(account->properties,
                                  g_strdup(ACCOUNT_USERAGENT),
                                  g_strdup(gtk_entry_get_text(GTK_ENTRY(entry_user_agent))));
 
+            gboolean v = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(use_stun_check_box));
             g_hash_table_replace(account->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED),
-                                 g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(use_stun_check_box)) ? "true":"false"));
+                                 bool_to_string(v));
 
             g_hash_table_replace(account->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER),
                                  g_strdup(gtk_entry_get_text(GTK_ENTRY(stun_server_entry))));
 
-            g_hash_table_replace(account->properties, g_strdup(PUBLISHED_SAMEAS_LOCAL), g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(same_as_local_radio_button)) ? "true":"false"));
+            v = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(same_as_local_radio_button));
+            g_hash_table_replace(account->properties, g_strdup(PUBLISHED_SAMEAS_LOCAL),
+                                 bool_to_string(v));
 
             if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(same_as_local_radio_button))) {
                 g_hash_table_replace(account->properties,
@@ -1351,13 +1320,14 @@ void show_account_window(account_t *account)
         }
 
         g_free(key_exchange);
+        const gboolean tls_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(use_sip_tls_check_box));
         g_hash_table_replace(account->properties, g_strdup(TLS_ENABLE),
-                             g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(use_sip_tls_check_box)) ? "true":"false"));
+                             bool_to_string(tls_enabled));
 
-        gboolean toneEnabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(enable_tone));
+        const gboolean tone_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(enable_tone));
         g_hash_table_replace(account->properties,
                              g_strdup(CONFIG_RINGTONE_ENABLED),
-                             g_strdup(toneEnabled ? "true" : "false"));
+                             bool_to_string(tone_enabled));
 
         g_hash_table_replace(account->properties,
                              g_strdup(CONFIG_RINGTONE_PATH),
@@ -1370,7 +1340,6 @@ void show_account_window(account_t *account)
         g_hash_table_replace(account->properties,
                              g_strdup(LOCAL_PORT),
                              g_strdup(gtk_entry_get_text(GTK_ENTRY(local_port_spin_box))));
-
     }
 
     /** @todo Verify if it's the best condition to check */
diff --git a/gnome/src/config/accountconfigdialog.h b/gnome/src/config/accountconfigdialog.h
index 72ae91724b..1683b269c2 100644
--- a/gnome/src/config/accountconfigdialog.h
+++ b/gnome/src/config/accountconfigdialog.h
@@ -39,7 +39,7 @@
 
 /**
  * Display the main account widget
- * @param a The account you want to edit or null for a new account
+ * @param a The account you want to display
  */
 void show_account_window(account_t *a);
 
diff --git a/gnome/src/config/accountlistconfigdialog.c b/gnome/src/config/accountlistconfigdialog.c
index f7f6eaa1d2..6562b6050d 100644
--- a/gnome/src/config/accountlistconfigdialog.c
+++ b/gnome/src/config/accountlistconfigdialog.c
@@ -71,15 +71,27 @@ static void delete_account_cb(void)
     selected_account = NULL;
 }
 
-static void edit_account_cb(void)
+static void row_activated_cb(GtkTreeView *view UNUSED,
+                             GtkTreePath *path UNUSED,
+                             GtkTreeViewColumn *col UNUSED,
+                             gpointer user_data UNUSED)
 {
     RETURN_IF_NULL(selected_account, "No selected account in edit action");
+    DEBUG("%s: accountID=%s\n", __PRETTY_FUNCTION__, selected_account->accountID);
+    show_account_window(selected_account);
+}
+
+static void edit_account_cb(GtkButton *button UNUSED, gpointer data UNUSED)
+{
+    RETURN_IF_NULL(selected_account, "No selected account in edit action");
+    DEBUG("%s: accountID=%s\n", __PRETTY_FUNCTION__, selected_account->accountID);
     show_account_window(selected_account);
 }
 
 static void add_account_cb(void)
 {
-    show_account_window(create_default_account());
+    account_t *new_account = create_default_account();
+    show_account_window(new_account);
 }
 
 static void account_store_fill(GtkTreeIter *iter, account_t *a)
@@ -152,6 +164,7 @@ select_account_cb(GtkTreeSelection *selection, GtkTreeModel *model)
     g_value_unset(&val);
 
     RETURN_IF_NULL(selected_account, "Selected account is NULL");
+    DEBUG("Selected account has accountID %s", selected_account->accountID);
 
     gtk_widget_set_sensitive(edit_button, TRUE);
 
@@ -427,8 +440,7 @@ create_account_list()
     gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), tree_view_column);
 
     // A double click on the account line opens the window to edit the account
-    g_signal_connect(G_OBJECT(tree_view), "row-activated",
-                     G_CALLBACK(edit_account_cb), NULL);
+    g_signal_connect(G_OBJECT(tree_view), "row-activated", G_CALLBACK(row_activated_cb), NULL);
     gtk_tree_view_column_set_cell_data_func(tree_view_column, renderer,
                                             highlight_ip_profile, NULL, NULL);
 
@@ -486,8 +498,7 @@ create_account_list()
 
     edit_button = gtk_button_new_from_stock(GTK_STOCK_EDIT);
     gtk_widget_set_sensitive(edit_button, FALSE);
-    g_signal_connect_swapped(G_OBJECT(edit_button), "clicked",
-                             G_CALLBACK(edit_account_cb), NULL);
+    g_signal_connect(G_OBJECT(edit_button), "clicked", G_CALLBACK(edit_account_cb), NULL);
     gtk_box_pack_start(GTK_BOX(button_box), edit_button, FALSE, FALSE, 0);
 
     delete_button = gtk_button_new_from_stock(GTK_STOCK_REMOVE);
diff --git a/gnome/src/config/audioconf.c b/gnome/src/config/audioconf.c
index 3f69218bb1..4289c8f7a5 100644
--- a/gnome/src/config/audioconf.c
+++ b/gnome/src/config/audioconf.c
@@ -70,15 +70,16 @@ static void active_is_always_recording(void);
 /**
  * Fills the tree list with supported codecs
  */
-static void preferences_dialog_fill_codec_list(account_t *a)
+static void
+preferences_dialog_fill_codec_list(const account_t *account)
 {
     // Get model of view and clear it
     GtkListStore *codecStore = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(codecTreeView)));
     gtk_list_store_clear(codecStore);
 
-    GQueue *current = a ? a->codecs : get_system_codec_list();
+    GQueue *current = account ? account->codecs : get_system_codec_list();
 
-    if (!a) DEBUG("Using system codec list");
+    if (!account) DEBUG("Using system codec list");
 
     // Insert codecs
     for (guint i = 0; i < g_queue_get_length(current); i++) {
@@ -517,7 +518,7 @@ static void codec_move_down(GtkButton *button UNUSED, gpointer data)
     codec_move(FALSE, data);
 }
 
-GtkWidget* audiocodecs_box(account_t *a)
+GtkWidget* audiocodecs_box(const account_t *account)
 {
     GtkWidget *audiocodecs_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
     gtk_container_set_border_width(GTK_CONTAINER(audiocodecs_hbox), 10);
@@ -548,7 +549,8 @@ GtkWidget* audiocodecs_box(account_t *a)
     gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn);
 
     // Toggle codec active property on clicked
-    g_signal_connect(G_OBJECT(renderer), "toggled", G_CALLBACK(codec_active_toggled),(gpointer) a);
+    g_signal_connect(G_OBJECT(renderer), "toggled",
+                     G_CALLBACK(codec_active_toggled), (gpointer) account);
 
     // Name column
     renderer = gtk_cell_renderer_text_new();
@@ -576,14 +578,16 @@ GtkWidget* audiocodecs_box(account_t *a)
     codecMoveUpButton = gtk_button_new_from_stock(GTK_STOCK_GO_UP);
     gtk_widget_set_sensitive(GTK_WIDGET(codecMoveUpButton), FALSE);
     gtk_box_pack_start(GTK_BOX(buttonBox), codecMoveUpButton, FALSE, FALSE, 0);
-    g_signal_connect(G_OBJECT(codecMoveUpButton), "clicked", G_CALLBACK(codec_move_up), a);
+    g_signal_connect(G_OBJECT(codecMoveUpButton), "clicked",
+                     G_CALLBACK(codec_move_up), (gpointer) account);
 
     codecMoveDownButton = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN);
     gtk_widget_set_sensitive(GTK_WIDGET(codecMoveDownButton), FALSE);
     gtk_box_pack_start(GTK_BOX(buttonBox), codecMoveDownButton, FALSE, FALSE, 0);
-    g_signal_connect(G_OBJECT(codecMoveDownButton), "clicked", G_CALLBACK(codec_move_down), a);
+    g_signal_connect(G_OBJECT(codecMoveDownButton), "clicked",
+                     G_CALLBACK(codec_move_down), (gpointer) account);
 
-    preferences_dialog_fill_codec_list(a);
+    preferences_dialog_fill_codec_list(account);
 
     return audiocodecs_hbox;
 }
diff --git a/gnome/src/config/audioconf.h b/gnome/src/config/audioconf.h
index 6f0b399f73..c3f3e221d1 100644
--- a/gnome/src/config/audioconf.h
+++ b/gnome/src/config/audioconf.h
@@ -38,7 +38,7 @@ GtkWidget* create_audio_configuration (void);
 GtkWidget* api_box();
 GtkWidget* alsa_box();
 GtkWidget* pulse_box();
-GtkWidget* audiocodecs_box();
+GtkWidget* audiocodecs_box(const account_t *a);
 GtkWidget* ringtone_box();
 
 gboolean get_api();
diff --git a/gnome/src/dbus/configurationmanager-introspec.xml b/gnome/src/dbus/configurationmanager-introspec.xml
index 926ff774de..879c62350a 100644
--- a/gnome/src/dbus/configurationmanager-introspec.xml
+++ b/gnome/src/dbus/configurationmanager-introspec.xml
@@ -21,7 +21,6 @@
                     The available keys / parameters are:
                     <ul>
                         <li>CONFIG_ACCOUNT_ENABLE:    True or False (Default: True)</li>
-                        <li>CONFIG_ACCOUNT_RESOLVE_ONCE</li>
                         <li>CONFIG_ACCOUNT_TYPE: SIP or IAX2 (Default: SIP)</li>
                         <li>HOSTNAME: The IP adress or hostname of the registrar</li>
                         <li>USERNAME: The username (or extension) of the account</li>
diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c
index 65381b3dd3..9045bb460e 100644
--- a/gnome/src/dbus/dbus.c
+++ b/gnome/src/dbus/dbus.c
@@ -1035,7 +1035,7 @@ dbus_remove_account(const gchar *accountID)
 }
 
 void
-dbus_set_account_details(account_t *a)
+dbus_set_account_details(const account_t *a)
 {
     g_assert(a);
     GError *error = NULL;
@@ -1049,6 +1049,7 @@ dbus_add_account(account_t *a)
 {
     g_assert(a);
     g_assert(a->properties);
+    DEBUG("Adding %s account", a->accountID);
     GError *error = NULL;
     g_free(a->accountID);
     a->accountID = NULL;
diff --git a/gnome/src/dbus/dbus.h b/gnome/src/dbus/dbus.h
index 3d2053e689..2fdccabe6b 100644
--- a/gnome/src/dbus/dbus.h
+++ b/gnome/src/dbus/dbus.h
@@ -123,7 +123,7 @@ GHashTable *dbus_get_account_details(const gchar *accountID);
  * ConfigurationManager - Set the details of a specific account
  * @param a The account to update
  */
-void dbus_set_account_details(account_t *a);
+void dbus_set_account_details(const account_t *a);
 
 /**
  * ConfigurationManager - Set the additional credential information
diff --git a/gnome/src/sflphone_const.h b/gnome/src/sflphone_const.h
index e642e0ae8e..f31f377c6d 100644
--- a/gnome/src/sflphone_const.h
+++ b/gnome/src/sflphone_const.h
@@ -48,24 +48,21 @@
 #define CONTACTS            "contacts"
 
 /** Locale */
-//#define _(STRING)             gettext( STRING )
-//#define N_(STRING)			  (STRING)
 #define c_(COMMENT,STRING)    gettext(STRING)
 #define n_(SING,PLUR,COUNT)   ngettext(SING,PLUR,COUNT)
 
-#define IP2IP	"IP2IP"
+#define IP2IP    "IP2IP"
 
 #define IP2IP_PROFILE                      "IP2IP"
 
 #define ACCOUNT_ID                         "Account.id"
 #define ACCOUNT_TYPE                       "Account.type"
-#define ACCOUNT_ALIAS		           "Account.alias"
-#define ACCOUNT_ENABLED		           "Account.enable"
-#define ACCOUNT_MAILBOX		           "Account.mailbox"
-#define ACCOUNT_USERAGENT	           "Account.useragent"
-#define ACCOUNT_RESOLVE_ONCE               "Account.resolveOnce"
+#define ACCOUNT_ALIAS                      "Account.alias"
+#define ACCOUNT_ENABLED                    "Account.enable"
+#define ACCOUNT_MAILBOX                    "Account.mailbox"
+#define ACCOUNT_USERAGENT                  "Account.useragent"
 #define ACCOUNT_REGISTRATION_EXPIRE        "Account.registrationExpire"
-#define ACCOUNT_SIP_STUN_SERVER	           "STUN.server"
+#define ACCOUNT_SIP_STUN_SERVER            "STUN.server"
 #define ACCOUNT_SIP_STUN_ENABLED           "STUN.enable"
 #define ACCOUNT_DTMF_TYPE                  "Account.dtmfType"
 #define ACCOUNT_HOSTNAME                   "Account.hostname"
@@ -84,45 +81,45 @@
 #define ZRTP                               "zrtp"
 #define SDES                               "sdes"
 
-#define CONFIG_RINGTONE_PATH                "Account.ringtonePath"
-#define CONFIG_RINGTONE_ENABLED             "Account.ringtoneEnabled"
-
-#define TLS_LISTENER_PORT                   "TLS.listenerPort"
-#define TLS_ENABLE                          "TLS.enable"
-#define TLS_PORT                            "TLS.port"
-#define TLS_CA_LIST_FILE                    "TLS.certificateListFile"
-#define TLS_CERTIFICATE_FILE                "TLS.certificateFile"
-#define TLS_PRIVATE_KEY_FILE                "TLS.privateKeyFile"
-#define TLS_PASSWORD                        "TLS.password"
-#define TLS_METHOD                          "TLS.method"
-#define TLS_CIPHERS                         "TLS.ciphers"
-#define TLS_SERVER_NAME                     "TLS.serverName"
-#define TLS_VERIFY_SERVER                   "TLS.verifyServer"
-#define TLS_VERIFY_CLIENT                   "TLS.verifyClient"
-#define TLS_REQUIRE_CLIENT_CERTIFICATE      "TLS.requireClientCertificate"
-#define TLS_NEGOTIATION_TIMEOUT_SEC         "TLS.negotiationTimeoutSec"
-#define TLS_NEGOTIATION_TIMEOUT_MSEC        "TLS.negotiationTimemoutMsec"
-
-#define LOCAL_INTERFACE                     "Account.localInterface"
-#define PUBLISHED_SAMEAS_LOCAL              "Account.publishedSameAsLocal"
-#define LOCAL_PORT                          "Account.localPort"
-#define PUBLISHED_PORT                      "Account.publishedPort"
-#define PUBLISHED_ADDRESS                   "Account.publishedAddress"
-
-#define REGISTRATION_STATUS                 "Registration.Status"
-#define REGISTRATION_STATE_CODE             "Registration.code"
-#define REGISTRATION_STATE_DESCRIPTION      "Registration.description"
-
-#define SHORTCUT_PICKUP                     "pickUp"
-#define SHORTCUT_HANGUP                     "hangUp"
-#define SHORTCUT_POPUP                      "popupWindow"
-#define SHORTCUT_TOGGLEPICKUPHANGUP         "togglePickupHangup"
-#define SHORTCUT_TOGGLEHOLD                 "toggleHold"
+#define CONFIG_RINGTONE_PATH               "Account.ringtonePath"
+#define CONFIG_RINGTONE_ENABLED            "Account.ringtoneEnabled"
+
+#define TLS_LISTENER_PORT                  "TLS.listenerPort"
+#define TLS_ENABLE                         "TLS.enable"
+#define TLS_PORT                           "TLS.port"
+#define TLS_CA_LIST_FILE                   "TLS.certificateListFile"
+#define TLS_CERTIFICATE_FILE               "TLS.certificateFile"
+#define TLS_PRIVATE_KEY_FILE               "TLS.privateKeyFile"
+#define TLS_PASSWORD                       "TLS.password"
+#define TLS_METHOD                         "TLS.method"
+#define TLS_CIPHERS                        "TLS.ciphers"
+#define TLS_SERVER_NAME                    "TLS.serverName"
+#define TLS_VERIFY_SERVER                  "TLS.verifyServer"
+#define TLS_VERIFY_CLIENT                  "TLS.verifyClient"
+#define TLS_REQUIRE_CLIENT_CERTIFICATE     "TLS.requireClientCertificate"
+#define TLS_NEGOTIATION_TIMEOUT_SEC        "TLS.negotiationTimeoutSec"
+#define TLS_NEGOTIATION_TIMEOUT_MSEC       "TLS.negotiationTimemoutMsec"
+
+#define LOCAL_INTERFACE                    "Account.localInterface"
+#define PUBLISHED_SAMEAS_LOCAL             "Account.publishedSameAsLocal"
+#define LOCAL_PORT                         "Account.localPort"
+#define PUBLISHED_PORT                     "Account.publishedPort"
+#define PUBLISHED_ADDRESS                  "Account.publishedAddress"
+
+#define REGISTRATION_STATUS                "Registration.Status"
+#define REGISTRATION_STATE_CODE            "Registration.code"
+#define REGISTRATION_STATE_DESCRIPTION     "Registration.description"
+
+#define SHORTCUT_PICKUP                    "pickUp"
+#define SHORTCUT_HANGUP                    "hangUp"
+#define SHORTCUT_POPUP                     "popupWindow"
+#define SHORTCUT_TOGGLEPICKUPHANGUP        "togglePickupHangup"
+#define SHORTCUT_TOGGLEHOLD                "toggleHold"
 
 /** Error while opening capture device */
-#define ALSA_CAPTURE_DEVICE	        0x0001
+#define ALSA_CAPTURE_DEVICE         0x0001
 /** Error while opening playback device */
-#define ALSA_PLAYBACK_DEVICE	    0x0010
+#define ALSA_PLAYBACK_DEVICE        0x0010
 /** Error pulseaudio */
 #define PULSEAUDIO_NOT_RUNNING      0x0100
 /** Error codecs not loaded */
@@ -136,11 +133,11 @@
 /** Tone to play when voice mails */
 #define TONE_WITH_MESSAGE     1
 /** Tells if the main window is reduced to the system tray or not */
-#define MINIMIZED	      TRUE
+#define MINIMIZED          TRUE
 /** Behaviour of the main window on incoming calls */
 #define __POPUP_WINDOW  (eel_gconf_get_integer (POPUP_ON_CALL))
 /** Show/Hide the volume controls */
-#define SHOW_VOLUME	(eel_gconf_get_integer (SHOW_VOLUME_CONTROLS) && must_show_alsa_conf())
+#define SHOW_VOLUME    (eel_gconf_get_integer (SHOW_VOLUME_CONTROLS) && must_show_alsa_conf())
 
 /** DTMF type */
 #define OVERRTP "overrtp"
@@ -154,7 +151,7 @@
 /** Messages ID for the status bar - Incoming calls */
 #define __MSG_INCOMING_CALL  0
 /** Messages ID for the status bar - Calling */
-#define __MSG_CALLING	     1
+#define __MSG_CALLING         1
 /** Messages ID for the status bar - Voice mails  notification */
 #define __MSG_VOICE_MAILS    2
 /** Messages ID for the status bar - Current account */
diff --git a/gnome/src/str_utils.c b/gnome/src/str_utils.c
index 9e395c1efb..cfa2a1e6dc 100644
--- a/gnome/src/str_utils.c
+++ b/gnome/src/str_utils.c
@@ -32,6 +32,8 @@
 
 gint utf8_case_cmp(const gchar *a, const gchar *b)
 {
+    g_assert(a);
+    g_assert(b);
     gchar *l = g_utf8_casefold(a, -1);
     gchar *r = g_utf8_casefold(b, -1);
     gint result = g_utf8_collate(l, r);
-- 
GitLab