mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
@@ -49,13 +49,8 @@ function FileManagerMenu:setUpdateItemTable()
|
||||
widget:addToMainMenu(self.tab_item_table)
|
||||
end
|
||||
|
||||
if Device:hasFrontlight() then
|
||||
table.insert(self.tab_item_table.main, {
|
||||
text = _("Frontlight settings"),
|
||||
callback = function()
|
||||
ReaderFrontLight:onShowFlDialog()
|
||||
end
|
||||
})
|
||||
if Device:getFrontlight() ~= nil then
|
||||
ReaderFrontLight:addToMainMenu(self.tab_item_table)
|
||||
end
|
||||
table.insert(self.tab_item_table.main, {
|
||||
text = _("Help"),
|
||||
|
||||
@@ -15,20 +15,6 @@ function FileChooser:init()
|
||||
Menu.init(self) -- call parent's init()
|
||||
end
|
||||
|
||||
function FileChooser:compressPath(path)
|
||||
local pos
|
||||
if path:sub(1, 1) ~= "/" then
|
||||
-- currently does not work with relative paths
|
||||
return path
|
||||
end
|
||||
path = path:gsub("/+", "/")
|
||||
-- compress paths like "test/pdf/../epub" into "test/epub"
|
||||
repeat
|
||||
path, pos = path:gsub("/?[^/]*/%.%.", "", 1)
|
||||
until pos == 0
|
||||
return path ~= "" and path or "/"
|
||||
end
|
||||
|
||||
function FileChooser:genItemTableFromPath(path)
|
||||
local dirs = {}
|
||||
local files = {}
|
||||
@@ -64,7 +50,7 @@ function FileChooser:genItemTableFromPath(path)
|
||||
end
|
||||
|
||||
function FileChooser:changeToPath(path)
|
||||
path = self:compressPath(path)
|
||||
path = util.realpath(path)
|
||||
self.path = path
|
||||
self:swithItemTable(nil, self:genItemTableFromPath(path))
|
||||
end
|
||||
|
||||
Submodule koreader-base updated: bc556f656b...6f8eaead56
Reference in New Issue
Block a user