From 24c94de702f3d1fbf6092fc96a9f430b88825afc Mon Sep 17 00:00:00 2001 From: Tristan Matthews <tristan.matthews@savoirfairelinux.com> Date: Wed, 18 Dec 2013 18:21:20 -0500 Subject: [PATCH] * #37154: gnome: fix some warnings --- gnome/src/actions.c | 12 +++++++----- gnome/src/contacts/calltree.c | 8 +++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/gnome/src/actions.c b/gnome/src/actions.c index ad3d4b6631..772bdd88a9 100644 --- a/gnome/src/actions.c +++ b/gnome/src/actions.c @@ -586,17 +586,18 @@ sflphone_new_call(SFLPhoneClient *client) if(nbcall == 0) dbus_screensaver_inhibit(); - callable_obj_t *current_selected_call = calltab_get_selected_call(current_calls_tab); + callable_obj_t *selected_call = calllist_empty(current_calls_tab) ? NULL : + calltab_get_selected_call(current_calls_tab); - if (current_selected_call != NULL) { - gchar *confID = dbus_get_conference_id(current_selected_call->_callID); + if (selected_call != NULL) { + gchar *confID = dbus_get_conference_id(selected_call->_callID); if(g_strcmp0(confID, "") != 0) { sflphone_on_hold(); } } // Play a tone when creating a new call - if (calllist_get_size(current_calls_tab) == 0) + if (calllist_empty(current_calls_tab)) dbus_start_tone(TRUE , (current_account_has_new_message() > 0) ? TONE_WITH_MESSAGE : TONE_WITHOUT_MESSAGE) ; callable_obj_t *c = create_new_call(CALL, CALL_STATE_DIALING, "", "", "", ""); @@ -614,7 +615,8 @@ sflphone_new_call(SFLPhoneClient *client) void sflphone_keypad(guint keyval, const gchar * key, SFLPhoneClient *client) { - callable_obj_t * c = calltab_get_selected_call(current_calls_tab); + callable_obj_t * c = calllist_empty(current_calls_tab) ? NULL : + calltab_get_selected_call(current_calls_tab); const gboolean current_is_active_tab = calltab_has_name(active_calltree_tab, CURRENT_CALLS); if (!current_is_active_tab || (current_is_active_tab && !c)) { diff --git a/gnome/src/contacts/calltree.c b/gnome/src/contacts/calltree.c index 5944fbec9a..24733092c3 100644 --- a/gnome/src/contacts/calltree.c +++ b/gnome/src/contacts/calltree.c @@ -581,9 +581,11 @@ calltree_remove_call(calltab_t* tab, const gchar *target_id) gtk_tree_model_foreach(model, remove_element_if_match, (gpointer) target_id); /* invalidate selected call if it was our target */ - callable_obj_t *sel = calltab_get_selected_call(tab); - if (sel && g_strcmp0(sel->_callID, target_id) == 0) - calltab_select_call(tab, NULL); + if (!calllist_empty(tab)) { + callable_obj_t *sel = calltab_get_selected_call(tab); + if (sel && g_strcmp0(sel->_callID, target_id) == 0) + calltab_select_call(tab, NULL); + } statusbar_update_clock(""); } -- GitLab