aboutsummaryrefslogtreecommitdiff
path: root/fastiv-io.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-21 21:05:45 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-21 21:07:51 +0100
commit1c57eef05ad73dadc3d647c973be9f37fde13a81 (patch)
treebc39287188f9b88c0be8d93915182e3d33eed452 /fastiv-io.c
parent5fea2245f119029f6b2699dda11aaf8f5e461e4e (diff)
downloadfiv-1c57eef05ad73dadc3d647c973be9f37fde13a81.tar.gz
fiv-1c57eef05ad73dadc3d647c973be9f37fde13a81.tar.xz
fiv-1c57eef05ad73dadc3d647c973be9f37fde13a81.zip
Sort files in the browser as well
Diffstat (limited to 'fastiv-io.c')
-rw-r--r--fastiv-io.c16
1 files changed, 16 insertions, 0 deletions
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;
+}