Blame SOURCES/0050-gui-don-t-remove-already-removed-GTimeoutSource.patch

562801
From 66abae485c6028345f21e80803e093a4dda292b3 Mon Sep 17 00:00:00 2001
562801
From: Jakub Filak <jfilak@redhat.com>
562801
Date: Wed, 30 Jul 2014 13:46:57 +0200
562801
Subject: [LIBREPORT PATCH 50/93] gui: don't remove already removed
562801
 GTimeoutSource
562801
562801
Was causing a GLib warning
562801
562801
Related to rhbz#1069917
562801
562801
Signed-off-by: Jakub Filak <jfilak@redhat.com>
562801
---
562801
 src/gui-wizard-gtk/wizard.c | 11 +++++++----
562801
 1 file changed, 7 insertions(+), 4 deletions(-)
562801
562801
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
562801
index 3dcc756..492feed 100644
562801
--- a/src/gui-wizard-gtk/wizard.c
562801
+++ b/src/gui-wizard-gtk/wizard.c
562801
@@ -2911,17 +2911,20 @@ static void on_sensitive_word_selection_changed(GtkTreeSelection *sel, gpointer
562801
     gtk_text_view_scroll_to_iter(new_word->tev, &(new_word->start), 0.0, false, 0, 0);
562801
 }
562801
 
562801
-static gboolean highlight_search(gpointer user_data)
562801
+static void highlight_search(GtkEntry *entry)
562801
 {
562801
-    GtkEntry *entry = GTK_ENTRY(user_data);
562801
-
562801
     g_search_text = gtk_entry_get_text(entry);
562801
 
562801
     log_notice("searching: '%s'", g_search_text);
562801
     GList *words = g_list_append(NULL, (gpointer)g_search_text);
562801
     highligh_words_in_tabs(words, NULL);
562801
     g_list_free(words);
562801
+}
562801
 
562801
+static gboolean highlight_search_on_timeout(gpointer user_data)
562801
+{
562801
+    g_timeout = 0;
562801
+    highlight_search(GTK_ENTRY(user_data));
562801
     /* returning false will make glib to remove this event */
562801
     return false;
562801
 }
562801
@@ -2935,7 +2938,7 @@ static void search_timeout(GtkEntry *entry)
562801
      */
562801
     if (g_timeout != 0)
562801
         g_source_remove(g_timeout);
562801
-    g_timeout = g_timeout_add(500, &highlight_search, (gpointer)entry);
562801
+    g_timeout = g_timeout_add(500, &highlight_search_on_timeout, (gpointer)entry);
562801
 }
562801
 
562801
 static void on_forbidden_words_toggled(GtkToggleButton *btn, gpointer user_data)
562801
-- 
562801
1.8.3.1
562801