From 0585258dc117b50cf8e8f6b5361fd815cc292cca Mon Sep 17 00:00:00 2001 From: Moritz Bruder Date: Wed, 4 Apr 2018 09:39:47 +0200 Subject: Add sort criterion by reversed extension segments The basenames of files are split by dots and then starting from the end each segment is compared to find a sort order. Example: bar.tar.bz2 foo.tar.bz2 a.bar.gz x.tar.gz z.tar.gz test.tex A heuristic determines what extension segments are part of the extension. There is probably no perfect solution but there are much less false positives. As a result the sorting is more intuitive and the displayed column in the list view is better readable and displays extensions more accurately. In addition a bug related to the default sort criteria in the preferences has been fixed. --- libcaja-private/caja-column-utilities.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libcaja-private/caja-column-utilities.c') diff --git a/libcaja-private/caja-column-utilities.c b/libcaja-private/caja-column-utilities.c index f63a2034..57dae7f5 100644 --- a/libcaja-private/caja-column-utilities.c +++ b/libcaja-private/caja-column-utilities.c @@ -139,6 +139,13 @@ get_builtin_columns (void) "description", _("The location of the file."), NULL)); + columns = g_list_append (columns, + g_object_new (CAJA_TYPE_COLUMN, + "name", "extension", + "attribute", "extension", + "label", _("Extension"), + "description", _("The extension of the file."), + NULL)); return columns; } -- cgit v1.2.1