From c01a9bac7ab053b824be6b26e8987a58f6d18f7d Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Fri, 28 Jun 2013 11:55:24 -0400
Subject: [PATCH] * #26594: gnome: fix deletion of history entries

---
 gnome/src/contacts/calllist.c |  4 ++++
 gnome/src/uimanager.c         | 23 +++++++++--------------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/gnome/src/contacts/calllist.c b/gnome/src/contacts/calllist.c
index 3fab976964..351a54eb35 100644
--- a/gnome/src/contacts/calllist.c
+++ b/gnome/src/contacts/calllist.c
@@ -165,6 +165,10 @@ calllist_remove_call(calltab_t* tab, const gchar * callID, SFLPhoneClient *clien
         g_queue_remove(tab->callQueue, call);
     }
 
+    /* If removing a call from the history, don't add it back to the history! */
+    if (calltab_has_name(tab, HISTORY))
+        return;
+
     /* Don't save empty (i.e. started dialing, then deleted) calls */
     if (call->_peer_number && strlen(call->_peer_number) > 0) {
         calllist_add_call(history_tab, call);
diff --git a/gnome/src/uimanager.c b/gnome/src/uimanager.c
index a7e8a5c725..ecaa74f1aa 100644
--- a/gnome/src/uimanager.c
+++ b/gnome/src/uimanager.c
@@ -760,20 +760,21 @@ call_configuration_assistant(G_GNUC_UNUSED GtkAction *action, G_GNUC_UNUSED gpoi
     build_wizard();
 }
 
-static void
-remove_from_history(G_GNUC_UNUSED GtkAction *action, SFLPhoneClient *client)
+typedef struct
 {
-    callable_obj_t* call = calltab_get_selected_call(history_tab);
-
-    g_debug("Remove the call from the history");
+    callable_obj_t *call;
+    SFLPhoneClient *client;
+} EditNumberData;
 
-    if (call == NULL) {
+static void
+remove_from_history(G_GNUC_UNUSED GtkAction *action, EditNumberData *data)
+{
+    if (data->call == NULL) {
         g_warning("Call is NULL");
         return;
     }
 
-    calllist_remove_from_history(call, client);
-    update_actions(client);
+    calllist_remove_from_history(data->call, data->client);
 }
 
 static void
@@ -1187,12 +1188,6 @@ fail:
     return NULL;
 }
 
-typedef struct
-{
-    callable_obj_t *call;
-    SFLPhoneClient *client;
-} EditNumberData;
-
 static void
 edit_number_cb(G_GNUC_UNUSED GtkWidget *widget, EditNumberData *data)
 {
-- 
GitLab