[nautilus/gnome-3-22] files-view, preferences: sync sort-directories-first with Gtk+
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/gnome-3-22] files-view, preferences: sync sort-directories-first with Gtk+
- Date: Fri, 9 Dec 2016 23:40:19 +0000 (UTC)
commit 73c3c92e4a26e6169d4aa16add38f3247347f446
Author: Felipe Borges <felipeborges gnome org>
Date: Mon Nov 7 16:01:01 2016 +0100
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
data/org.gnome.nautilus.gschema.xml | 5 -----
src/nautilus-files-view.c | 8 ++++----
src/nautilus-preferences-window.c | 15 +--------------
3 files changed, 5 insertions(+), 23 deletions(-)
---
diff --git a/data/org.gnome.nautilus.gschema.xml b/data/org.gnome.nautilus.gschema.xml
index c05faf3..17982cc 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 6d32acd..0d94e7c 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -2593,7 +2593,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)
{
@@ -3013,7 +3013,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);
@@ -9164,7 +9164,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);
@@ -9186,7 +9186,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 2df9e4a..77cf273 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]