[nautilus] Sync the GTK+ setting for 'sort-directories-first'



commit 004db388fa8a4e784ee3ec5f31b811aaf6a30c4d
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Apr 18 11:37:36 2014 -0400

    Sync the GTK+ setting for 'sort-directories-first'
    
    The GTK+ filechooser has its own setting for this. Keep it in
    sync when changing this property in nautilus.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728513

 src/nautilus-file-management-properties.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-file-management-properties.c b/src/nautilus-file-management-properties.c
index f1c7f80..5c388ea 100644
--- a/src/nautilus-file-management-properties.c
+++ b/src/nautilus-file-management-properties.c
@@ -429,6 +429,17 @@ bind_builder_bool (GtkBuilder *builder,
                         "active", G_SETTINGS_BIND_DEFAULT);
 }
 
+static void
+bind_builder_bool_oneway (GtkBuilder *builder,
+                         GSettings *settings,
+                         const char *widget_name,
+                         const char *prefs)
+{
+       g_settings_bind (settings, prefs,
+                        gtk_builder_get_object (builder, widget_name),
+                        "active", G_SETTINGS_BIND_SET);
+}
+
 static gboolean
 enum_get_mapping (GValue             *value,
                  GVariant           *variant,
@@ -607,6 +618,9 @@ nautilus_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow
        bind_builder_bool (builder, nautilus_preferences,
                           NAUTILUS_FILE_MANAGEMENT_PROPERTIES_FOLDERS_FIRST_WIDGET,
                           NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
+       bind_builder_bool_oneway (builder, gtk_filechooser_preferences,
+                                 NAUTILUS_FILE_MANAGEMENT_PROPERTIES_FOLDERS_FIRST_WIDGET,
+                          NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
 
        bind_builder_bool (builder, nautilus_preferences,
                           NAUTILUS_FILE_MANAGEMENT_PROPERTIES_TRASH_CONFIRM_WIDGET,


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