From 1c57eef05ad73dadc3d647c973be9f37fde13a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sun, 21 Nov 2021 21:05:45 +0100 Subject: Sort files in the browser as well --- fastiv-io.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'fastiv-io.c') diff --git a/fastiv-io.c b/fastiv-io.c index d9588cc..fd956ef 100644 --- a/fastiv-io.c +++ b/fastiv-io.c @@ -1048,3 +1048,19 @@ fastiv_io_lookup_thumbnail(const gchar *target, FastivIoThumbnailSize size) g_free(uri); return result; } + +int +fastiv_io_filecmp(GFile *location1, GFile *location2) +{ + if (g_file_has_prefix(location1, location2)) + return +1; + if (g_file_has_prefix(location2, location1)) + return -1; + + gchar *name1 = g_file_get_parse_name(location1); + gchar *name2 = g_file_get_parse_name(location2); + int result = g_utf8_collate(name1, name2); + g_free(name1); + g_free(name2); + return result; +} -- cgit v1.2.3