[gtk+/gtk-3-18] GtkTreeView: Make a search window destroy helper



commit 3a53352afea55ae949aa3b09de883d416473f45e
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Sun Oct 18 21:12:59 2015 +0800

    GtkTreeView: Make a search window destroy helper
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756780

 gtk/gtktreeview.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 8a3c65a..e365bfc 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2108,6 +2108,16 @@ gtk_tree_view_free_rbtree (GtkTreeView *tree_view)
 }
 
 static void
+gtk_tree_view_destroy_search_window (GtkTreeView *tree_view)
+{
+  gtk_widget_destroy (tree_view->priv->search_window);
+
+  tree_view->priv->search_window = NULL;
+  tree_view->priv->search_entry = NULL;
+  tree_view->priv->search_entry_changed_id = 0;
+}
+
+static void
 gtk_tree_view_destroy (GtkWidget *widget)
 {
   GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
@@ -2181,9 +2191,7 @@ gtk_tree_view_destroy (GtkWidget *widget)
   /* destroy interactive search dialog */
   if (tree_view->priv->search_window)
     {
-      gtk_widget_destroy (tree_view->priv->search_window);
-      tree_view->priv->search_window = NULL;
-      tree_view->priv->search_entry = NULL;
+      gtk_tree_view_destroy_search_window (tree_view);
       if (tree_view->priv->typeselect_flush_timeout)
        {
          g_source_remove (tree_view->priv->typeselect_flush_timeout);
@@ -15011,10 +15019,7 @@ gtk_tree_view_set_search_entry (GtkTreeView *tree_view,
     }
   else if (tree_view->priv->search_window)
     {
-      gtk_widget_destroy (tree_view->priv->search_window);
-
-      tree_view->priv->search_window = NULL;
-      tree_view->priv->search_entry_changed_id = 0;
+      gtk_tree_view_destroy_search_window (tree_view);
     }
 
   if (entry)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]