file chooser: Clear search entry when it goes away
authorMatthias Clasen <mclasen@redhat.com>
Tue, 7 Jul 2015 00:50:08 +0000 (20:50 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 7 Jul 2015 00:50:08 +0000 (20:50 -0400)
Keeping the entry contents conflicts with type-to-search.

gtk/gtkfilechooserwidget.c

index aa9ecdae71e95afe14b9f4b0bcef6c920e553230..7638930c97164624c03f90180d9ec6960567c425 100644 (file)
@@ -2951,7 +2951,7 @@ operation_mode_stop (GtkFileChooserWidget *impl,
   if (mode == OPERATION_MODE_SEARCH)
     {
       g_clear_object (&impl->priv->model_for_search);
-      search_stop_searching (impl, FALSE);
+      search_stop_searching (impl, TRUE);
       search_clear_model (impl, TRUE);
     }
 }
@@ -6928,10 +6928,9 @@ search_stop_searching (GtkFileChooserWidget *impl,
 {
   GtkFileChooserWidgetPrivate *priv = impl->priv;
 
-  if (remove_query && priv->search_query)
+  if (remove_query && priv->search_entry)
     {
-      g_object_unref (priv->search_query);
-      priv->search_query = NULL;
+      gtk_entry_set_text (GTK_ENTRY (priv->search_entry), "");
     }
 
   if (priv->search_engine)