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.
pull/4148/merge
alethiophile 6 years ago committed by poire-z
parent 3fcd7344e4
commit 637abfdf84

@ -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")},

@ -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

Loading…
Cancel
Save