summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Borges <felipeborges@gnome.org>2016-11-07 16:01:01 +0100
committerFelipe Borges <felipeborges@gnome.org>2016-11-07 16:13:43 +0100
commite1443f8d5cc438ab96e2ee2433b34de300d533d3 (patch)
treede48bef3e18930044b122587153beb5067da4747
parent0366338cf471809729b2d00de6134e38cf29d7f9 (diff)
downloadnautilus-e1443f8d5cc438ab96e2ee2433b34de300d533d3.tar.gz
files-view, preferences: sync sort-directories-first with Gtk+
The sort-directories-first gsetting should be consistent system-wise. https://bugzilla.gnome.org/show_bug.cgi?id=750996
-rw-r--r--data/org.gnome.nautilus.gschema.xml5
-rw-r--r--src/nautilus-files-view.c8
-rw-r--r--src/nautilus-preferences-window.c15
3 files changed, 5 insertions, 23 deletions
diff --git a/data/org.gnome.nautilus.gschema.xml b/data/org.gnome.nautilus.gschema.xml
index c05faf303..17982cc66 100644
--- a/data/org.gnome.nautilus.gschema.xml
+++ b/data/org.gnome.nautilus.gschema.xml
@@ -167,11 +167,6 @@
<summary>Maximum image size for thumbnailing</summary>
<description>Images over this size (in bytes) won't be thumbnailed. The purpose of this setting is to avoid thumbnailing large images that may take a long time to load or use lots of memory.</description>
</key>
- <key type="b" name="sort-directories-first">
- <default>false</default>
- <summary>Show folders first in windows</summary>
- <description>If set to true, then Nautilus shows folders prior to showing files in the icon and list views.</description>
- </key>
<key name="default-sort-order" enum="org.gnome.nautilus.SortOrder">
<aliases>
<alias value='modification_date' target='mtime'/>
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index ba19de34c..33fb283e5 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -2610,7 +2610,7 @@ sort_directories_first_changed_callback (gpointer callback_data)
view = NAUTILUS_FILES_VIEW (callback_data);
preference_value =
- g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
+ g_settings_get_boolean (gtk_filechooser_preferences, NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
if (preference_value != view->details->sort_directories_first)
{
@@ -3030,7 +3030,7 @@ nautilus_files_view_destroy (GtkWidget *object)
schedule_update_context_menus, view);
g_signal_handlers_disconnect_by_func (nautilus_preferences,
click_policy_changed_callback, view);
- g_signal_handlers_disconnect_by_func (nautilus_preferences,
+ g_signal_handlers_disconnect_by_func (gtk_filechooser_preferences,
sort_directories_first_changed_callback, view);
g_signal_handlers_disconnect_by_func (gtk_filechooser_preferences,
show_hidden_files_changed_callback, view);
@@ -9206,7 +9206,7 @@ nautilus_files_view_init (NautilusFilesView *view)
update_templates_directory (view);
view->details->sort_directories_first =
- g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
+ g_settings_get_boolean (gtk_filechooser_preferences, NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
view->details->show_hidden_files =
g_settings_get_boolean (gtk_filechooser_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES);
@@ -9228,7 +9228,7 @@ nautilus_files_view_init (NautilusFilesView *view)
"changed::" NAUTILUS_PREFERENCES_CLICK_POLICY,
G_CALLBACK (click_policy_changed_callback),
view);
- g_signal_connect_swapped (nautilus_preferences,
+ g_signal_connect_swapped (gtk_filechooser_preferences,
"changed::" NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST,
G_CALLBACK (sort_directories_first_changed_callback), view);
g_signal_connect_swapped (gtk_filechooser_preferences,
diff --git a/src/nautilus-preferences-window.c b/src/nautilus-preferences-window.c
index 2df9e4afe..77cf27355 100644
--- a/src/nautilus-preferences-window.c
+++ b/src/nautilus-preferences-window.c
@@ -477,28 +477,15 @@ static void 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_preferences_window_setup(GtkBuilder *builder,
GtkWindow *parent_window)
{
GtkWidget *window;
/* setup preferences */
- bind_builder_bool (builder, nautilus_preferences,
+ bind_builder_bool (builder, gtk_filechooser_preferences,
NAUTILUS_PREFERENCES_DIALOG_FOLDERS_FIRST_WIDGET,
NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
- g_signal_connect (
- gtk_builder_get_object (builder,
- NAUTILUS_PREFERENCES_DIALOG_FOLDERS_FIRST_WIDGET),
- "notify::active", G_CALLBACK (set_gtk_filechooser_sort_first), NULL);
-
bind_builder_bool (builder, nautilus_preferences,
NAUTILUS_PREFERENCES_DIALOG_TRASH_CONFIRM_WIDGET,
NAUTILUS_PREFERENCES_CONFIRM_TRASH);