From fe128b5b4d198a39c74a1a81b7a3e27f12262ff8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 1 Jul 2015 08:40:15 -0700 Subject: [PATCH] file chooser: Don't show recent in save mode Don't show Recent in the sidebar when we are in save mode. We also ignore the startup-mode = recent in save mode now - we don't want to populate the file list with recent files if Recent is not on the sidebar. If you really want to go there, you can still enter recent:// in the location entry. https://bugzilla.gnome.org/show_bug.cgi?id=751653 --- gtk/gtkfilechooserwidget.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index cb304faf61..eb34ef7eb7 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -549,6 +549,7 @@ static void settings_load (GtkFileChooserWidget *impl); static void show_filters (GtkFileChooserWidget *impl, gboolean show); +static gboolean recent_files_setting_is_enabled (GtkFileChooserWidget *impl); static void recent_start_loading (GtkFileChooserWidget *impl); static void recent_stop_loading (GtkFileChooserWidget *impl); static void recent_clear_model (GtkFileChooserWidget *impl, @@ -2731,6 +2732,7 @@ update_appearance (GtkFileChooserWidget *impl) { save_widgets_create (impl); gtk_places_sidebar_set_show_enter_location (GTK_PLACES_SIDEBAR (priv->places_sidebar), FALSE); + gtk_places_sidebar_set_show_recent (GTK_PLACES_SIDEBAR (priv->places_sidebar), FALSE); if (priv->select_multiple) { @@ -2738,12 +2740,14 @@ update_appearance (GtkFileChooserWidget *impl) "Re-setting to single selection mode."); set_select_multiple (impl, FALSE, TRUE); } + } else if (priv->action == GTK_FILE_CHOOSER_ACTION_OPEN || priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) { save_widgets_destroy (impl); gtk_places_sidebar_set_show_enter_location (GTK_PLACES_SIDEBAR (priv->places_sidebar), TRUE); + gtk_places_sidebar_set_show_recent (GTK_PLACES_SIDEBAR (priv->places_sidebar), recent_files_setting_is_enabled (impl)); location_mode_set (impl, priv->location_mode); } @@ -3374,7 +3378,7 @@ set_startup_mode (GtkFileChooserWidget *impl) switch (priv->startup_mode) { case STARTUP_MODE_RECENT: - if (recent_files_setting_is_enabled (impl)) + if (gtk_places_sidebar_get_show_recent (GTK_PLACES_SIDEBAR (priv->places_sidebar))) { operation_mode_set (impl, OPERATION_MODE_RECENT); break; -- 2.30.2