diff options
author | Jonas Ã…dahl <jadahl@gmail.com> | 2015-10-18 21:12:59 +0800 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-11-09 08:40:25 -0500 |
commit | 3a53352afea55ae949aa3b09de883d416473f45e (patch) | |
tree | e35961a1242b90645e1ad23ece24e7ec9df64f6c /gtk | |
parent | ea449a032a6e6d864b4467aa70b6b2d7bbe9babf (diff) | |
download | gtk+-3a53352afea55ae949aa3b09de883d416473f45e.tar.gz |
GtkTreeView: Make a search window destroy helper
https://bugzilla.gnome.org/show_bug.cgi?id=756780
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtktreeview.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 8a3c65ab1d..e365bfc1d7 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) |