[gtk+] file chooser: Fix gtk_file_chooser_set_show_hidden
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] file chooser: Fix gtk_file_chooser_set_show_hidden
- Date: Fri, 24 Jul 2015 02:00:08 +0000 (UTC)
commit e2b9caf26affe5fbc3422b1cb1f9f3df4d1d7b90
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jul 23 21:54:47 2015 -0400
file chooser: Fix gtk_file_chooser_set_show_hidden
We should not override an explicitly set show-hidden value
when loading the setting.
https://bugzilla.gnome.org/show_bug.cgi?id=610925
gtk/gtkfilechooserwidget.c | 32 ++++++++++++++++++++------------
1 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index c0d8e97..fa58375 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -343,6 +343,7 @@ struct _GtkFileChooserWidgetPrivate {
guint use_preview_label : 1;
guint select_multiple : 1;
guint show_hidden : 1;
+ guint show_hidden_set : 1;
guint sort_directories_first : 1;
guint show_time : 1;
guint do_overwrite_confirmation : 1;
@@ -3254,6 +3255,21 @@ gtk_file_chooser_widget_get_subtitle (GtkFileChooserWidget *impl)
}
static void
+set_show_hidden (GtkFileChooserWidget *impl,
+ gboolean show_hidden)
+{
+ GtkFileChooserWidgetPrivate *priv = impl->priv;
+
+ if (priv->show_hidden != show_hidden)
+ {
+ priv->show_hidden = show_hidden;
+
+ if (priv->browse_files_model)
+ _gtk_file_system_model_set_show_hidden (priv->browse_files_model, show_hidden);
+ }
+}
+
+static void
gtk_file_chooser_widget_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -3355,16 +3371,8 @@ gtk_file_chooser_widget_set_property (GObject *object,
break;
case GTK_FILE_CHOOSER_PROP_SHOW_HIDDEN:
- {
- gboolean show_hidden = g_value_get_boolean (value);
- if (show_hidden != priv->show_hidden)
- {
- priv->show_hidden = show_hidden;
-
- if (priv->browse_files_model)
- _gtk_file_system_model_set_show_hidden (priv->browse_files_model, show_hidden);
- }
- }
+ priv->show_hidden_set = TRUE;
+ set_show_hidden (impl, g_value_get_boolean (value));
break;
case GTK_FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION:
@@ -3767,8 +3775,8 @@ settings_load (GtkFileChooserWidget *impl)
sort_directories_first = g_settings_get_boolean (settings, SETTINGS_KEY_SORT_DIRECTORIES_FIRST);
date_format = g_settings_get_enum (settings, SETTINGS_KEY_DATE_FORMAT);
- gtk_file_chooser_set_show_hidden (GTK_FILE_CHOOSER (impl), show_hidden);
-
+ if (!priv->show_hidden_set)
+ set_show_hidden (impl, show_hidden);
priv->show_size_column = show_size_column;
gtk_tree_view_column_set_visible (priv->list_size_column, show_size_column);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]