summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2015-10-18 21:12:59 +0800
committerMatthias Clasen <mclasen@redhat.com>2015-11-09 08:40:25 -0500
commit3a53352afea55ae949aa3b09de883d416473f45e (patch)
treee35961a1242b90645e1ad23ece24e7ec9df64f6c /gtk
parentea449a032a6e6d864b4467aa70b6b2d7bbe9babf (diff)
downloadgtk+-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.c19
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)