From 637abfdf84fb1125e05952bc73e41f80a612cb46 Mon Sep 17 00:00:00 2001 From: alethiophile Date: Tue, 7 Aug 2018 13:23:19 -0600 Subject: [PATCH] Various changes to sorting (#4067) Don't consider sidecar file when sorting by access time. Rename 'sort by title' to 'sort by filename': This is in accordance with the actual function of the code, which uses filename rather than title as specified in file metadata. --- frontend/apps/filemanager/filemanager.lua | 2 +- frontend/ui/widget/filechooser.lua | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/frontend/apps/filemanager/filemanager.lua b/frontend/apps/filemanager/filemanager.lua index 97689fd70..2b165f4e0 100644 --- a/frontend/apps/filemanager/filemanager.lua +++ b/frontend/apps/filemanager/filemanager.lua @@ -742,7 +742,7 @@ end function FileManager:getSortingMenuTable() local fm = self local collates = { - strcoll = {_("title"), _("Sort by title")}, + strcoll = {_("filename"), _("Sort by filename")}, access = {_("date read"), _("Sort by last read date")}, change = {_("date added"), _("Sort by date added")}, modification = {_("date modified"), _("Sort by date modified")}, diff --git a/frontend/ui/widget/filechooser.lua b/frontend/ui/widget/filechooser.lua index 14bc85132..a6050488d 100644 --- a/frontend/ui/widget/filechooser.lua +++ b/frontend/ui/widget/filechooser.lua @@ -126,12 +126,6 @@ function FileChooser:genItemTableFromPath(path) end elseif self.collate == "access" then sorting = function(a, b) - if DocSettings:hasSidecarFile(a.fullpath) and not DocSettings:hasSidecarFile(b.fullpath) then - return true - end - if not DocSettings:hasSidecarFile(a.fullpath) and DocSettings:hasSidecarFile(b.fullpath) then - return false - end return a.attr.access > b.attr.access end elseif self.collate == "modification" then