summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2018-11-26 17:49:10 +0000
committerCarlos Soriano <csoriano1618@gmail.com>2018-12-07 15:44:15 +0000
commit947d28a904a2db12ac371ed124e37376c77f59b0 (patch)
tree4c2e35db426bc72561e290262d18f5e561740d42 /src
parent8940f90aa2690b5a1e139b4150580392ec723016 (diff)
downloadnautilus-947d28a904a2db12ac371ed124e37376c77f59b0.tar.gz
file: Sync sort types with settings
The org.gnome.nautilus.preferences default-sort-order key is a currently hidden-from-UI preference that should be honored by all views, if no custom order is specified in the current location's metadata. However, for this to work, two enums must be kept in sync between the code and the schemas. This has not been happening since the introduction of the Starred files feature. To fix this, restore the sort order according to settings, and make starred take the place of trash-time, which is non-sensical as default for all folders. Forthermore, to prevent this from breaking again, add documentation to both enums. Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/636
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-file.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/nautilus-file.h b/src/nautilus-file.h
index 8fce62505..ce5f57846 100644
--- a/src/nautilus-file.h
+++ b/src/nautilus-file.h
@@ -50,13 +50,21 @@ typedef struct NautilusFile NautilusFile;
(G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_FILE, NautilusFileClass))
typedef enum {
- NAUTILUS_FILE_SORT_NONE,
- NAUTILUS_FILE_SORT_BY_DISPLAY_NAME,
- NAUTILUS_FILE_SORT_BY_SIZE,
- NAUTILUS_FILE_SORT_BY_TYPE,
- NAUTILUS_FILE_SORT_BY_STARRED,
- NAUTILUS_FILE_SORT_BY_MTIME,
- NAUTILUS_FILE_SORT_BY_ATIME,
+ /* These may be set as default-sort-order. When touching this, make sure to
+ * keep the values in sync with the "org.gnome.nautilus.SortOrder" enum in the
+ * `data/org.gnome.nautilus.gschema.xml` schemas file.
+ */
+ NAUTILUS_FILE_SORT_NONE = 0, /* Formerly used for "manual" sorting. */
+ NAUTILUS_FILE_SORT_BY_DISPLAY_NAME = 1,
+ NAUTILUS_FILE_SORT_BY_SIZE = 2,
+ NAUTILUS_FILE_SORT_BY_TYPE = 3,
+ NAUTILUS_FILE_SORT_BY_MTIME = 4,
+ NAUTILUS_FILE_SORT_BY_ATIME = 5,
+ NAUTILUS_FILE_SORT_BY_STARRED = 6,
+
+ /* The following are specific to special locations and as such are not to be
+ * included in the "org.gnome.nautilus.SortOrder" enum.
+ */
NAUTILUS_FILE_SORT_BY_TRASHED_TIME,
NAUTILUS_FILE_SORT_BY_SEARCH_RELEVANCE,
NAUTILUS_FILE_SORT_BY_RECENCY