[gtk+/gtk-3-0: 8/14] Discard the search widgets in a separate function



commit 14b9b2f3e0c3f6987bb0c2f72733c03cafea3dce
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Jul 27 16:52:12 2011 -0500

    Discard the search widgets in a separate function
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 gtk/gtkfilechooserdefault.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index a7f7eb9..7541158 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -5226,6 +5226,18 @@ path_bar_update (GtkFileChooserDefault *impl)
   path_bar_set_mode (impl, mode);
 }
 
+static void
+operation_mode_discard_search_widgets (GtkFileChooserDefault *impl)
+{
+  if (impl->search_hbox)
+    {
+      gtk_widget_destroy (impl->search_hbox);
+
+      impl->search_hbox = NULL;
+      impl->search_entry = NULL;
+    }
+}
+
 /* Stops running operations like populating the browse model, searches, and the recent-files model */
 static void
 operation_mode_stop (GtkFileChooserDefault *impl, OperationMode mode)
@@ -5240,9 +5252,7 @@ operation_mode_stop (GtkFileChooserDefault *impl, OperationMode mode)
       search_stop_searching (impl, FALSE);
       search_clear_model (impl, TRUE);
 
-      gtk_widget_destroy (impl->search_hbox);
-      impl->search_hbox = NULL;
-      impl->search_entry = NULL;
+      operation_mode_discard_search_widgets (impl);
       break;
 
     case OPERATION_MODE_RECENT:



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