mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
FileBrowser: change page to show last file or previous subdir (#3351)
When going from reader to filemanager, we are in the directory
containing the last_file. With this, we will also be on the page
showing this file.
When in filemanager and going up (".."), we will also be on the
page containing the directory we came from.
This commit is contained in:
@@ -365,16 +365,16 @@ end
|
||||
function ReaderUI:showFileManager()
|
||||
local FileManager = require("apps/filemanager/filemanager")
|
||||
local QuickStart = require("ui/quickstart")
|
||||
local lastdir
|
||||
local last_dir
|
||||
local last_file = G_reader_settings:readSetting("lastfile")
|
||||
-- ignore quickstart guide as last_file so we can go back to home dir
|
||||
if last_file and last_file ~= QuickStart.quickstart_filename then
|
||||
lastdir = last_file:match("(.*)/")
|
||||
last_dir = last_file:match("(.*)/")
|
||||
end
|
||||
if FileManager.instance then
|
||||
FileManager.instance:reinit(lastdir)
|
||||
FileManager.instance:reinit(last_dir, last_file)
|
||||
else
|
||||
FileManager:showFiles(lastdir)
|
||||
FileManager:showFiles(last_dir, last_file)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user