Pass ui parameter to all collate item_funcs

This commit is contained in:
Wim de With
2025-06-22 15:01:51 +02:00
parent c456d18fa3
commit 84cd057d39
2 changed files with 2 additions and 5 deletions

View File

@@ -183,7 +183,7 @@ function FileChooser:getListItem(dirpath, f, fullpath, attributes, collate)
item.text = item.text.."/"
item.bidi_wrap_func = BD.directory
if collate.can_collate_mixed and collate.item_func ~= nil then -- used by user plugin/patch, don't remove
collate.item_func(item)
collate.item_func(item, self.ui)
end
if dirpath then -- file browser or PathChooser
item.mandatory = self:getMenuItemMandatory(item)

View File

@@ -22,10 +22,7 @@ local PathChooser = FileChooser:extend{
}
function PathChooser:init()
local collate = G_reader_settings:readSetting("collate")
if self.show_files and (collate == "title" or collate == "authors" or collate == "series" or collate == "keywords") then
self.ui = require("apps/reader/readerui").instance or require("apps/filemanager/filemanager").instance
end
self.ui = require("apps/reader/readerui").instance or require("apps/filemanager/filemanager").instance
if self.title == true then -- default title depending on options
if self.select_directory and not self.select_file then