Blame 0017-gui-clear-the-sensitive-cache-between-two-event-runs.patch

Jakub Filak ef61d27
From 109702a42d08e52f54c5f740b370a3ec9a3a5d16 Mon Sep 17 00:00:00 2001
Jakub Filak ef61d27
From: Jakub Filak <jfilak@redhat.com>
Jakub Filak ef61d27
Date: Wed, 30 Jul 2014 13:44:02 +0200
Jakub Filak ef61d27
Subject: [PATCH 17/20] gui: clear the sensitive cache between two event runs
Jakub Filak ef61d27
Jakub Filak ef61d27
Was causing a SIGSEGV.
Jakub Filak ef61d27
Jakub Filak ef61d27
Related to rhbz#1069917
Jakub Filak ef61d27
Jakub Filak ef61d27
Signed-off-by: Jakub Filak <jfilak@redhat.com>
Jakub Filak ef61d27
---
Jakub Filak ef61d27
 src/gui-wizard-gtk/wizard.c | 25 +++++++++++++++++++++++++
Jakub Filak ef61d27
 1 file changed, 25 insertions(+)
Jakub Filak ef61d27
Jakub Filak ef61d27
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
Jakub Filak ef61d27
index 5c4bd6a..fc44547 100644
Jakub Filak ef61d27
--- a/src/gui-wizard-gtk/wizard.c
Jakub Filak ef61d27
+++ b/src/gui-wizard-gtk/wizard.c
Jakub Filak ef61d27
@@ -1123,6 +1123,31 @@ static void remove_tabs_from_notebook(GtkNotebook *notebook)
Jakub Filak ef61d27
         */
Jakub Filak ef61d27
         gtk_notebook_remove_page(notebook, 0); //we need to always the page 0
Jakub Filak ef61d27
     }
Jakub Filak ef61d27
+
Jakub Filak ef61d27
+    /* Turn off the changed callback during the update */
Jakub Filak ef61d27
+    g_signal_handler_block(g_tv_sensitive_sel, g_tv_sensitive_sel_hndlr);
Jakub Filak ef61d27
+
Jakub Filak ef61d27
+    g_current_highlighted_word = NULL;
Jakub Filak ef61d27
+
Jakub Filak ef61d27
+    GtkTreeIter iter;
Jakub Filak ef61d27
+    gboolean valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_ls_sensitive_list), &iter);
Jakub Filak ef61d27
+    while (valid)
Jakub Filak ef61d27
+    {
Jakub Filak ef61d27
+        char *text = NULL;
Jakub Filak ef61d27
+        search_item_t *word = NULL;
Jakub Filak ef61d27
+
Jakub Filak ef61d27
+        gtk_tree_model_get(GTK_TREE_MODEL(g_ls_sensitive_list), &iter,
Jakub Filak ef61d27
+                SEARCH_COLUMN_TEXT, &text,
Jakub Filak ef61d27
+                SEARCH_COLUMN_ITEM, &word,
Jakub Filak ef61d27
+                -1);
Jakub Filak ef61d27
+
Jakub Filak ef61d27
+        free(text);
Jakub Filak ef61d27
+        free(word);
Jakub Filak ef61d27
+
Jakub Filak ef61d27
+        valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(g_ls_sensitive_list), &iter);
Jakub Filak ef61d27
+    }
Jakub Filak ef61d27
+    gtk_list_store_clear(g_ls_sensitive_list);
Jakub Filak ef61d27
+    g_signal_handler_unblock(g_tv_sensitive_sel, g_tv_sensitive_sel_hndlr);
Jakub Filak ef61d27
 }
Jakub Filak ef61d27
 
Jakub Filak ef61d27
 static void append_item_to_ls_details(gpointer name, gpointer value, gpointer data)
Jakub Filak ef61d27
-- 
Jakub Filak ef61d27
2.0.4
Jakub Filak ef61d27