From 09c21f992efe9359233448fd448fc022450539fe Mon Sep 17 00:00:00 2001
From: Alexandre Savard <alexandresavard@msavard.(none)>
Date: Tue, 21 Jun 2011 14:06:09 -0400
Subject: [PATCH] #6231: Fix drag-n-drop issue

---
 sflphone-client-gnome/src/actions.c           |  20 +-
 sflphone-client-gnome/src/contacts/calltab.c  |  12 ++
 sflphone-client-gnome/src/contacts/calltab.h  |   2 +
 sflphone-client-gnome/src/contacts/calltree.c |  11 +-
 sflphone-client-gnome/src/dbus/dbus.c         | 187 ++++++++++--------
 sflphone-client-gnome/src/uimanager.c         |   6 +-
 6 files changed, 132 insertions(+), 106 deletions(-)

diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c
index 8c45c22dae..9a7047ff41 100644
--- a/sflphone-client-gnome/src/actions.c
+++ b/sflphone-client-gnome/src/actions.c
@@ -471,14 +471,15 @@ sflphone_pick_up()
                 dbus_accept (selectedCall);
                 stop_notification();
                 break;
-            case CALL_STATE_HOLD:
+            casecalllist_remove_call(current_calls, selectedCall); CALL_STATE_HOLD:
                 sflphone_new_call();
                 break;
             case CALL_STATE_TRANSFERT:
                 dbus_transfert (selectedCall);
                 set_timestamp (&selectedCall->_time_stop);
                 calltree_remove_call(current_calls, selectedCall, NULL);
-                break;
+                calllist_remove_call(current_calls, selectedCall);
+		break;
             case CALL_STATE_CURRENT:
             case CALL_STATE_RECORD:
                 sflphone_new_call();
@@ -826,6 +827,7 @@ sflphone_keypad (guint keyval, gchar * key)
                         dbus_transfert (c);
                         set_timestamp (&c->_time_stop);
                         calltree_remove_call(current_calls, c, NULL);
+			calllist_remove_call(current_calls, c->_callID);
                         break;
                     case 65307: /* ESCAPE */
                         sflphone_unset_transfert (c);
@@ -1324,26 +1326,12 @@ void sflphone_fill_history (void)
 	        ptr = g_strsplit(value, delim, 6);
 		if(ptr != NULL) {
 
-		    DEBUG("!!!!!!!!!!!!!!!!!!!!!!!!!!!! %s", *ptr);
-
 		    // first ptr refers to entry type
 		    if(g_strcmp0(*ptr, "2188") == 0) {
-		        DEBUG("---------------------------------- HISTORY VALUE %s", value);
 			create_conference_history_entry_from_serialized((gchar *)key, (gchar **)ptr, &conference_entry);
 			conferencelist_add (history, conference_entry);
 			calltree_add_conference (history, conference_entry);
 			conferencelist_add(current_calls, conference_entry);
-/*
-		        GSList *part = conference_entry->participant_list;
-
-			while(part) {
-			    callable_obj_t *call_to_add = NULL;
-			    gchar *call_id = (gchar *)part->data;
-			    call_to_add = calllist_get_call(history, call_id);
-
-			    calltree_add_call();
-                        }	
-*/
 			g_hash_table_remove(entries, key_to_min);	
 		    }
 		    else {
diff --git a/sflphone-client-gnome/src/contacts/calltab.c b/sflphone-client-gnome/src/contacts/calltab.c
index 0d8d4a5c90..60fc51f3ad 100644
--- a/sflphone-client-gnome/src/contacts/calltab.c
+++ b/sflphone-client-gnome/src/contacts/calltab.c
@@ -94,6 +94,18 @@ calltab_get_selected_conf (calltab_t *tab)
     return tab->selectedConf;
 }
 
+void
+calltab_unselect_all(calltab_t *tab) 
+{
+    if(tab == NULL) {
+        ERROR("CallTab: Tab is NULL");
+	return;
+    }
+
+    tab->selectedCall = NULL;
+    tab->selectedConf = NULL;
+}
+
 void
 calltab_create_searchbar (calltab_t* tab)
 {
diff --git a/sflphone-client-gnome/src/contacts/calltab.h b/sflphone-client-gnome/src/contacts/calltab.h
index ce3df9c2a8..6ed4c1a9ac 100644
--- a/sflphone-client-gnome/src/contacts/calltab.h
+++ b/sflphone-client-gnome/src/contacts/calltab.h
@@ -64,6 +64,8 @@ calltab_get_selected_call (calltab_t *);
 conference_obj_t *
 calltab_get_selected_conf (calltab_t *);
 
+void calltab_unselect_all(calltab_t *);
+
 void
 calltab_create_searchbar (calltab_t *);
 
diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c
index f99fa289f8..c7f7a9ad1e 100644
--- a/sflphone-client-gnome/src/contacts/calltree.c
+++ b/sflphone-client-gnome/src/contacts/calltree.c
@@ -206,7 +206,7 @@ row_activated (GtkTreeView       *tree_view UNUSED,
 
     if (calltab_get_selected_type (active_calltree) == A_CALL) {
 
-	DEBUG("CallTree: Selected a conference");
+	DEBUG("CallTree: Selected a call");
 
         selectedCall = calltab_get_selected_call (active_calltree);
 
@@ -287,8 +287,14 @@ row_activated (GtkTreeView       *tree_view UNUSED,
 	    }
 
 	    calltree_create_conf_from_participant_list(selectedConf->participant_list); 
-        }
+       
+	    calltree_display(current_calls); 
+	}
     }
+
+    calltab_unselect_all(current_calls);
+    calltab_unselect_all(history);
+    calltab_unselect_all(contacts);
 }
 
 static void 
@@ -1957,6 +1963,7 @@ static void menuitem_response( gchar *string )
         DEBUG("Calltree: Transfering call %s, to %s", selected_call->_peer_number, dragged_call->_peer_number);
         dbus_attended_transfer(selected_call, dragged_call);
         calltree_remove_call(current_calls, selected_call, NULL);
+	calllist_remove_call(current_calls, selected_call->_callID);
     }
     else {
         DEBUG("CallTree: Error unknown option selected in menu %s", string);
diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c
index cc38c1953d..dbdfae944b 100644
--- a/sflphone-client-gnome/src/dbus/dbus.c
+++ b/sflphone-client-gnome/src/dbus/dbus.c
@@ -10,7 +10,7 @@
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty f
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
@@ -66,7 +66,7 @@ new_call_created_cb (DBusGProxy *proxy UNUSED, const gchar *accountID,
     gchar *peer_name = (gchar *)to;
     gchar *peer_number = "";
 
-    DEBUG("DBus: New Call (%s) created to (%s)", callID, to);
+    DEBUG("DBUS: New Call (%s) created to (%s)", callID, to);
 
     create_new_call(CALL, CALL_STATE_RINGING, g_strdup(callID), g_strdup(accountID), 
 			peer_name, peer_number, &c);
@@ -114,7 +114,7 @@ static void
 zrtp_negotiation_failed_cb (DBusGProxy *proxy UNUSED, const gchar* callID,
                             const gchar* reason, const gchar* severity, void * foo  UNUSED)
 {
-    DEBUG ("Zrtp negotiation failed.");
+    DEBUG ("DBUS: Zrtp negotiation failed.");
     main_window_zrtp_negotiation_failed (callID, reason, severity);
     callable_obj_t * c = NULL;
     c = calllist_get_call (current_calls, callID);
@@ -134,7 +134,7 @@ static void
 volume_changed_cb (DBusGProxy *proxy UNUSED, const gchar* device, const gdouble value,
                    void * foo  UNUSED)
 {
-    DEBUG ("Volume of %s changed to %f.",device, value);
+    DEBUG ("DBUS: Volume of %s changed to %f.",device, value);
     set_slider (device, value);
 }
 
@@ -142,14 +142,14 @@ static void
 voice_mail_cb (DBusGProxy *proxy UNUSED, const gchar* accountID, const guint nb,
                void * foo  UNUSED)
 {
-    DEBUG ("%d Voice mail waiting!",nb);
+    DEBUG ("DBUS: %d Voice mail waiting!",nb);
     sflphone_notify_voice_mail (accountID, nb);
 }
 
 static void
 incoming_message_cb (DBusGProxy *proxy UNUSED, const gchar* callID UNUSED, const gchar *from, const gchar* msg, void * foo  UNUSED)
 {
-    DEBUG ("Message \"%s\" from %s!", msg, from);
+    DEBUG ("DBUS: Message \"%s\" from %s!", msg, from);
 
     callable_obj_t *call = NULL;
     conference_obj_t *conf = NULL;
@@ -193,7 +193,7 @@ call_state_cb (DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* state
     DEBUG ("DBUS: Call %s state %s",callID, state);
     callable_obj_t *c = calllist_get_call (current_calls, callID);
     if(c == NULL) {
-	ERROR("DBUS: Call is NULL");
+	ERROR("DBUS: Error: Call is NULL in ");
     }
 
     if (c) {
@@ -274,67 +274,70 @@ conference_changed_cb (DBusGProxy *proxy UNUSED, const gchar* confID,
     callable_obj_t *call;
     gchar* call_id;
 
+    DEBUG ("DBUS: Conference state changed: %s\n", state);
+
     // sflphone_display_transfer_status("Transfer successfull");
     conference_obj_t* changed_conf = conferencelist_get (current_calls, confID);
     GSList * part;
 
-    DEBUG ("---------------------------- DBUS: Conference state changed: %s\n", state);
-
-    if (changed_conf) {
-        // remove old conference from calltree
-        calltree_remove_conference (current_calls, changed_conf, NULL);
-
-        // update conference state
-        if (strcmp (state, "ACTIVE_ATACHED") == 0) {
-            changed_conf->_state = CONFERENCE_STATE_ACTIVE_ATACHED;
-        } else if (strcmp (state, "ACTIVE_DETACHED") == 0) {
-            changed_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED;
-        } else if (strcmp (state, "ACTIVE_ATTACHED_REC") == 0) {
-            changed_conf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD;
-        } else if (strcmp(state, "ACTIVE_DETACHED_REC") == 0) {
-             changed_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED_RECORD;
-        } else if (strcmp (state, "HOLD") == 0) {
-            changed_conf->_state = CONFERENCE_STATE_HOLD;
-        } else if (strcmp(state, "HOLD_REC") == 0) {
-            changed_conf->_state = CONFERENCE_STATE_HOLD_RECORD;
-        } else {
-            DEBUG ("Error: conference state not recognized");
-        }
-
-        // reactivate instant messaging window for these calls
-        part = changed_conf->participant_list;
+    if(changed_conf == NULL) {
+	ERROR("DBUS: Conference is NULL in conference state changed");
+	return;
+    }
+
+    // remove old conference from calltree
+    calltree_remove_conference (current_calls, changed_conf, NULL);
+
+    // update conference state
+    if (strcmp (state, "ACTIVE_ATACHED") == 0) {
+        changed_conf->_state = CONFERENCE_STATE_ACTIVE_ATACHED;
+    } else if (strcmp (state, "ACTIVE_DETACHED") == 0) {
+        changed_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED;
+    } else if (strcmp (state, "ACTIVE_ATTACHED_REC") == 0) {
+        changed_conf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD;
+    } else if (strcmp(state, "ACTIVE_DETACHED_REC") == 0) {
+        changed_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED_RECORD;
+    } else if (strcmp (state, "HOLD") == 0) {
+        changed_conf->_state = CONFERENCE_STATE_HOLD;
+    } else if (strcmp(state, "HOLD_REC") == 0) {
+        changed_conf->_state = CONFERENCE_STATE_HOLD_RECORD;
+    } else {
+        DEBUG ("Error: conference state not recognized");
+    }
 
-        while (part) {
-            call_id = (gchar*) (part->data);
-            call = calllist_get_call (current_calls, call_id);
+    // reactivate instant messaging window for these calls
+    part = changed_conf->participant_list;
 
-            if (call && call->_im_widget) {
-                im_widget_update_state (IM_WIDGET (call->_im_widget), TRUE);
-	    }
+    while (part) {
+        call_id = (gchar*) (part->data);
+        call = calllist_get_call (current_calls, call_id);
 
-            part = g_slist_next (part);
-        }
+        if (call && call->_im_widget) {
+            im_widget_update_state (IM_WIDGET (call->_im_widget), TRUE);
+	}
 
-        // update conferece participants
-        conference_participant_list_update (dbus_get_participant_list (changed_conf->_confID), changed_conf);
+        part = g_slist_next (part);
+    }
 
-        // deactivate instant messaging window for new participants
-        part = changed_conf->participant_list;
+    // update conferece participants
+    conference_participant_list_update (dbus_get_participant_list (changed_conf->_confID), changed_conf);
 
-        while (part) {
-            call_id = (gchar*) (part->data);
-            call = calllist_get_call (current_calls, call_id);
+    // deactivate instant messaging window for new participants
+    part = changed_conf->participant_list;
 
-            if (call && call->_im_widget) {
-                im_widget_update_state (IM_WIDGET (call->_im_widget), FALSE);
-	    }
+    while (part) {
+        call_id = (gchar*) (part->data);
+        call = calllist_get_call (current_calls, call_id);
 
-            part = g_slist_next (part);
-        }
+        if (call && call->_im_widget) {
+            im_widget_update_state (IM_WIDGET (call->_im_widget), FALSE);
+	}
 
-        // add new conference to calltree
-        calltree_add_conference (current_calls, changed_conf);
+        part = g_slist_next (part);
     }
+
+    // add new conference to calltree
+    calltree_add_conference (current_calls, changed_conf);
 }
 
 static void
@@ -425,7 +428,7 @@ conference_removed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo
 static void
 accounts_changed_cb (DBusGProxy *proxy UNUSED, void * foo  UNUSED)
 {
-    DEBUG ("Accounts changed");
+    DEBUG ("DBUS: Accounts changed");
     sflphone_fill_account_list();
     sflphone_fill_ip2ip_profile();
     account_list_config_dialog_fill();
@@ -441,21 +444,21 @@ accounts_changed_cb (DBusGProxy *proxy UNUSED, void * foo  UNUSED)
 static void
 transfer_succeded_cb (DBusGProxy *proxy UNUSED, void * foo  UNUSED)
 {
-    DEBUG ("Transfer succeded\n");
+    DEBUG ("DBUS: Transfer succeded");
     sflphone_display_transfer_status ("Transfer successfull");
 }
 
 static void
 transfer_failed_cb (DBusGProxy *proxy UNUSED, void * foo  UNUSED)
 {
-    DEBUG ("Transfer failed\n");
+    DEBUG ("DBUS: Transfer failed");
     sflphone_display_transfer_status ("Transfer failed");
 }
 
 static void
 secure_sdes_on_cb (DBusGProxy *proxy UNUSED, const gchar *callID, void *foo UNUSED)
 {
-    DEBUG ("SRTP using SDES is on");
+    DEBUG ("DBUS: SRTP using SDES is on");
     callable_obj_t *c = calllist_get_call (current_calls, callID);
 
     if (c) {
@@ -468,7 +471,7 @@ secure_sdes_on_cb (DBusGProxy *proxy UNUSED, const gchar *callID, void *foo UNUS
 static void
 secure_sdes_off_cb (DBusGProxy *proxy UNUSED, const gchar *callID, void *foo UNUSED)
 {
-    DEBUG ("SRTP using SDES is off");
+    DEBUG ("DBUS: SRTP using SDES is off");
     callable_obj_t *c = calllist_get_call (current_calls, callID);
 
     if (c) {
@@ -481,7 +484,7 @@ static void
 secure_zrtp_on_cb (DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* cipher,
                    void * foo  UNUSED)
 {
-    DEBUG ("SRTP using ZRTP is ON secure_on_cb");
+    DEBUG ("DBUS: SRTP using ZRTP is ON secure_on_cb");
     callable_obj_t * c = calllist_get_call (current_calls, callID);
 
     if (c) {
@@ -495,7 +498,7 @@ secure_zrtp_on_cb (DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* c
 static void
 secure_zrtp_off_cb (DBusGProxy *proxy UNUSED, const gchar* callID, void * foo  UNUSED)
 {
-    DEBUG ("SRTP using ZRTP is OFF");
+    DEBUG ("DBUS: SRTP using ZRTP is OFF");
     callable_obj_t * c = calllist_get_call (current_calls, callID);
 
     if (c) {
@@ -508,7 +511,7 @@ static void
 show_zrtp_sas_cb (DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* sas,
                   const gboolean verified, void * foo  UNUSED)
 {
-    DEBUG ("Showing SAS");
+    DEBUG ("DBUS: Showing SAS");
     callable_obj_t * c = calllist_get_call (current_calls, callID);
 
     if (c) {
@@ -519,7 +522,8 @@ show_zrtp_sas_cb (DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* sa
 static void
 confirm_go_clear_cb (DBusGProxy *proxy UNUSED, const gchar* callID, void * foo  UNUSED)
 {
-    DEBUG ("Confirm Go Clear request");
+    DEBUG ("DBUS: Confirm Go Clear request");
+
     callable_obj_t * c = calllist_get_call (current_calls, callID);
 
     if (c) {
@@ -544,9 +548,11 @@ sip_call_state_cb (DBusGProxy *proxy UNUSED, const gchar* callID,
                    const gchar* description, const guint code, void * foo  UNUSED)
 {
     callable_obj_t * c = NULL;
-    c = calllist_get_call (current_calls, callID);
 
-    if (c != NULL) {
+    DEBUG("DBUS: Sip call state changed %s", callID);
+
+    c = calllist_get_call (current_calls, callID);
+    if (c == NULL) {
         ERROR("DBUS: Error call is NULL in state changed");
         return;
     }
@@ -557,7 +563,7 @@ sip_call_state_cb (DBusGProxy *proxy UNUSED, const gchar* callID,
 static void
 error_alert (DBusGProxy *proxy UNUSED, int errCode, void * foo  UNUSED)
 {
-    ERROR ("Error notifying : (%i)", errCode);
+    ERROR ("DBUS: Error notifying : (%i)", errCode);
     sflphone_throw_exception (errCode);
 }
 
@@ -768,9 +774,10 @@ dbus_clean()
 void
 dbus_hold (const callable_obj_t * c)
 {
-    DEBUG ("dbus_hold %s\n", c->_callID);
-
     GError *error = NULL;
+    
+    DEBUG ("DBUS: Hold %s\n", c->_callID);
+    
     org_sflphone_SFLphone_CallManager_hold (callManagerProxy, c->_callID, &error);
 
     if (error) {
@@ -783,9 +790,10 @@ dbus_hold (const callable_obj_t * c)
 void
 dbus_unhold (const callable_obj_t * c)
 {
-    DEBUG ("dbus_unhold %s\n", c->_callID);
-
     GError *error = NULL;
+    
+    DEBUG ("DBUS: Unhold call %s\n", c->_callID);
+    
     org_sflphone_SFLphone_CallManager_unhold (callManagerProxy, c->_callID, &error);
 
     if (error) {
@@ -798,7 +806,7 @@ dbus_unhold (const callable_obj_t * c)
 void
 dbus_hold_conference (const conference_obj_t * c)
 {
-    DEBUG ("dbus_hold_conference %s\n", c->_confID);
+    DEBUG ("DBUS: Hold conference %s\n", c->_confID);
 
     GError *error = NULL;
     org_sflphone_SFLphone_CallManager_hold_conference (callManagerProxy,
@@ -814,7 +822,7 @@ dbus_hold_conference (const conference_obj_t * c)
 void
 dbus_unhold_conference (const conference_obj_t * c)
 {
-    DEBUG ("dbus_unhold_conference %s\n", c->_confID);
+    DEBUG ("DBUS: Unold conference %s\n", c->_confID);
 
     GError *error = NULL;
     org_sflphone_SFLphone_CallManager_unhold_conference (callManagerProxy,
@@ -830,7 +838,7 @@ dbus_unhold_conference (const conference_obj_t * c)
 void
 dbus_hang_up (const callable_obj_t * c)
 {
-    DEBUG ("dbus_hang_up %s\n", c->_callID);
+    DEBUG ("DBUS: Hang up call %s\n", c->_callID);
 
     GError *error = NULL;
     org_sflphone_SFLphone_CallManager_hang_up (callManagerProxy, c->_callID,
@@ -846,15 +854,13 @@ dbus_hang_up (const callable_obj_t * c)
 void
 dbus_hang_up_conference (const conference_obj_t * c)
 {
-    DEBUG ("dbus_hang_up_conference %s\n", c->_confID);
+    DEBUG ("DBUS: Hang up conference %s\n", c->_confID);
 
     GError *error = NULL;
-    org_sflphone_SFLphone_CallManager_hang_up_conference (callManagerProxy,
-            c->_confID, &error);
+    org_sflphone_SFLphone_CallManager_hang_up_conference (callManagerProxy, c->_confID, &error);
 
     if (error) {
-        ERROR ("Failed to call hang_up() on CallManager: %s",
-               error->message);
+        ERROR ("Failed to call hang_up() on CallManager: %s", error->message);
         g_error_free (error);
     }
 }
@@ -863,6 +869,9 @@ void
 dbus_transfert (const callable_obj_t * c)
 {
     GError *error = NULL;
+
+    DEBUG("DBUS: Transfer: %s\n", c->_callID);
+
     org_sflphone_SFLphone_CallManager_transfert (callManagerProxy, c->_callID,
             c->_trsft_to, &error);
 
@@ -876,7 +885,7 @@ dbus_transfert (const callable_obj_t * c)
 void
 dbus_attended_transfer (const callable_obj_t *transfer, const callable_obj_t *target)
 {
-    DEBUG("DBUS: Attended tramsfer %s to %s", transfer->_callID, target->_callID);
+    DEBUG("DBUS: Attended tramsfer %s to %s\n", transfer->_callID, target->_callID);
 
     GError *error = NULL;
     org_sflphone_SFLphone_CallManager_attended_transfer (callManagerProxy, transfer->_callID,
@@ -896,7 +905,7 @@ dbus_accept (const callable_obj_t * c)
     status_tray_icon_blink (FALSE);
 #endif
 
-    DEBUG ("dbus_accept %s\n", c->_callID);
+    DEBUG ("DBUS: Accept call %s\n", c->_callID);
 
     GError *error = NULL;
     org_sflphone_SFLphone_CallManager_accept (callManagerProxy, c->_callID, &error);
@@ -915,7 +924,7 @@ dbus_refuse (const callable_obj_t * c)
     status_tray_icon_blink (FALSE);
 #endif
 
-    DEBUG ("dbus_refuse %s\n", c->_callID);
+    DEBUG ("DBUS: Refuse call %s\n", c->_callID);
 
     GError *error = NULL;
     org_sflphone_SFLphone_CallManager_refuse (callManagerProxy, c->_callID, &error);
@@ -931,6 +940,9 @@ void
 dbus_place_call (const callable_obj_t * c)
 {
     GError *error = NULL;
+ 
+    DEBUG("DBUS: Place call %s", c->_callID);
+
     org_sflphone_SFLphone_CallManager_place_call (callManagerProxy, c->_accountID,
             c->_callID, c->_peer_number, &error);
 
@@ -970,7 +982,7 @@ dbus_get_account_details (gchar * accountID)
     GError *error = NULL;
     GHashTable * details;
 
-    DEBUG ("Dbus: Get account detail accountid %s", accountID);
+    DEBUG ("Dbus: Get account detail for %s", accountID);
 
     if (!org_sflphone_SFLphone_ConfigurationManager_get_account_details (
                 configurationManagerProxy, accountID, &details, &error)) {
@@ -991,8 +1003,10 @@ dbus_get_account_details (gchar * accountID)
 void
 dbus_set_credential (account_t *a, int index)
 {
-    DEBUG ("Sending credential %d to server", index);
     GError *error = NULL;
+    
+    DEBUG ("DBUS: Sending credential %d to server", index);
+    
     GHashTable * credential = g_ptr_array_index (a->credential_information, index);
 
     if (credential == NULL) {
@@ -1011,8 +1025,9 @@ dbus_set_credential (account_t *a, int index)
 void
 dbus_delete_all_credential (account_t *a)
 {
-    DEBUG ("Deleting all credentials\n");
     GError *error = NULL;
+    
+    DEBUG ("DBUS: Deleting all credentials");
 
     org_sflphone_SFLphone_ConfigurationManager_delete_all_credential (
         configurationManagerProxy, a->accountID, &error);
@@ -1030,7 +1045,7 @@ dbus_get_number_of_credential (gchar * accountID)
     GError *error = NULL;
     int number = 0;
 
-    DEBUG ("Getting number of credential for account %s", accountID);
+    DEBUG ("DBUS: Getting number of credential for account %s", accountID);
 
     if (!org_sflphone_SFLphone_ConfigurationManager_get_number_of_credential (
                 configurationManagerProxy, accountID, &number, &error)) {
@@ -1055,6 +1070,8 @@ dbus_get_credential (gchar * accountID, int index)
     GError *error = NULL;
     GHashTable * details;
 
+    DEBUG("DBUS: Get credential for account %s", accountID);
+
     if (!org_sflphone_SFLphone_ConfigurationManager_get_credential (
                 configurationManagerProxy, accountID, index, &details, &error)) {
         if (error->domain == DBUS_GERROR && error->code
diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c
index 63bd16a1ab..6d0817b9b1 100644
--- a/sflphone-client-gnome/src/uimanager.c
+++ b/sflphone-client-gnome/src/uimanager.c
@@ -125,8 +125,7 @@ update_actions()
     }
 
     if (is_inserted (GTK_WIDGET (transferToolbar), GTK_WIDGET (toolbar))) {
-        gtk_container_remove (GTK_CONTAINER (toolbar),
-                              GTK_WIDGET (transferToolbar));
+        gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (transferToolbar));
     }
 
     if (is_inserted (GTK_WIDGET (historyButton), GTK_WIDGET (toolbar))) {
@@ -206,8 +205,9 @@ update_actions()
 
     gboolean instant_messaging_enabled = TRUE;
     
-    if (eel_gconf_key_exists (INSTANT_MESSAGING_ENABLED))
+    if (eel_gconf_key_exists (INSTANT_MESSAGING_ENABLED)) {
         instant_messaging_enabled = eel_gconf_get_integer (INSTANT_MESSAGING_ENABLED);
+    }
 
     if (selectedCall) {
 
-- 
GitLab