summaryrefslogtreecommitdiff
path: root/src/nautilus-canvas-view.c
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2018-11-29 00:14:31 +0000
committerCarlos Soriano <csoriano1618@gmail.com>2018-12-07 15:44:15 +0000
commitbc4ea00e95a7e0cb0722a16dbef3d99241daf070 (patch)
tree5c17c2a0d4d33857485771e6c1f1145275f0cf37 /src/nautilus-canvas-view.c
parentd6effd2d6c4d222f1b7893dc12699d9272eea153 (diff)
downloadnautilus-bc4ea00e95a7e0cb0722a16dbef3d99241daf070.tar.gz
file: Centralize getting default sort order
nautilus_file_get_default_sort_type() has a misleading name. It doesn't actually get the default sort type for any folder, but only for certain special folders. For regular folders, the default comes from GSettings keys, but this is implemented in the views instead, with a lot of reduncant code. So, let's do that in nautilus_file_get_default_sort_type() directly, and clearly document it.
Diffstat (limited to 'src/nautilus-canvas-view.c')
-rw-r--r--src/nautilus-canvas-view.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 4ee8d6ea3..ffbc59814 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -407,21 +407,14 @@ nautilus_canvas_view_get_directory_sort_by (NautilusCanvasView *canvas_view,
static const SortCriterion *
get_default_sort_order (NautilusFile *file)
{
- NautilusFileSortType sort_type, default_sort_order;
+ NautilusFileSortType sort_type;
gboolean reversed;
- default_sort_order = g_settings_get_enum (nautilus_preferences,
- NAUTILUS_PREFERENCES_DEFAULT_SORT_ORDER);
- reversed = g_settings_get_boolean (nautilus_preferences,
- NAUTILUS_PREFERENCES_DEFAULT_SORT_IN_REVERSE_ORDER);
-
- /* If this is a special folder (e.g. search or recent), override the sort
- * order and reversed flag with values appropriate for the folder */
sort_type = nautilus_file_get_default_sort_type (file, &reversed);
if (sort_type == NAUTILUS_FILE_SORT_NONE)
{
- sort_type = CLAMP (default_sort_order,
+ sort_type = CLAMP (sort_type,
NAUTILUS_FILE_SORT_BY_DISPLAY_NAME,
NAUTILUS_FILE_SORT_BY_ATIME);
}