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

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