[nautilus] Fix the sort-directories-first setting handling



commit 5e4e82cccea45b9283c0338f1559d709ae51d982
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Sep 1 14:56:39 2014 -0400

    Fix the sort-directories-first setting handling
    
    Sadly, we can't bind two settings to the same object property,
    so use a manual handler for the :notify::active signal instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730867

 src/nautilus-file-management-properties.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-file-management-properties.c b/src/nautilus-file-management-properties.c
index 5c388ea..9c2608a 100644
--- a/src/nautilus-file-management-properties.c
+++ b/src/nautilus-file-management-properties.c
@@ -597,6 +597,14 @@ bind_builder_radio (GtkBuilder *builder,
        }
 }
 
+static void
+set_gtk_filechooser_sort_first (GObject *object,
+                               GParamSpec *pspec)
+{
+       g_settings_set_boolean (gtk_filechooser_preferences,
+                               NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST,
+                               gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (object)));
+}
 
 static  void
 nautilus_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *window)
@@ -618,9 +626,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);
+       g_signal_connect (gtk_builder_get_object (builder, 
NAUTILUS_FILE_MANAGEMENT_PROPERTIES_FOLDERS_FIRST_WIDGET),
+                          "notify::active",
+                          G_CALLBACK (set_gtk_filechooser_sort_first), NULL);
 
        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]