diff options
author | Rajat Jain <rajatjain.ix@gmail.com> | 2021-04-19 17:50:15 +0530 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2021-11-16 17:56:31 +0000 |
commit | a3369c5a4b36275d624939ac9e8dd5643aef2996 (patch) | |
tree | 7dff75b252d9bfe99194f86151286d8259d894ff | |
parent | b002cb626d1376e1231dcd888f06b843e16294bc (diff) | |
download | nautilus-a3369c5a4b36275d624939ac9e8dd5643aef2996.tar.gz |
file: use specific file type for Sort by Type
Adds file comparison based on actual file type, rather than generic
type category. For example .jpg and .png files will now be sorted
into two different groups.
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1776
Signed-off-by: Rajat Jain <rajatjain.ix@gmail.com>
-rw-r--r-- | src/nautilus-file.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c index c14356d8f..5d6efdcb2 100644 --- a/src/nautilus-file.c +++ b/src/nautilus-file.c @@ -3480,6 +3480,11 @@ compare_by_type (NautilusFile *file_1, } result = g_utf8_collate (type_string_1, type_string_2); + if (result == 0) + { + /* Among files of the same (generic) type, sort them by mime type. */ + result = g_utf8_collate (file_1->details->mime_type, file_2->details->mime_type); + } g_free (type_string_1); g_free (type_string_2); |