[gtk+] file chooser: Reload current dir when switching from search mode



commit 8f71060ef9569fb476d53e190b2afd7c7d898a8a
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Feb 15 22:06:17 2016 -0500

    file chooser: Reload current dir when switching from search mode
    
    The need for this was pointed out by Evangelos Foutras in
    https://bugzilla.gnome.org/show_bug.cgi?id=761757

 gtk/gtkfilechooserwidget.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 1364def..c93c9a1 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -593,6 +593,7 @@ static void     clear_model_cache            (GtkFileChooserWidget *impl,
                                               gint                  column);
 static void     set_model_filter             (GtkFileChooserWidget *impl,
                                               GtkFileFilter        *filter);
+static void     switch_to_home_dir           (GtkFileChooserWidget *impl);
 
 
 
@@ -2563,10 +2564,18 @@ static void
 location_entry_changed_cb (GtkEditable          *editable,
                            GtkFileChooserWidget *impl)
 {
-  if (impl->priv->operation_mode == OPERATION_MODE_SEARCH)
-    operation_mode_set (impl, OPERATION_MODE_BROWSE);
+  GtkFileChooserWidgetPrivate *priv = impl->priv;
+
+  if (priv->operation_mode == OPERATION_MODE_SEARCH)
+    {
+      operation_mode_set (impl, OPERATION_MODE_BROWSE);
+      if (priv->current_folder)
+        change_folder_and_display_error (impl, priv->current_folder, FALSE);
+      else
+        switch_to_home_dir (impl);
+    }
 
-  if (impl->priv->action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
+  if (priv->action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
     reset_location_timeout (impl);
 }
 


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