mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Delegate "lastfile" management to ReadHistory (#6128)
Simplify (and avoid edge cases) in other code by having ReadHistory manage the "lastfile" setting on add, remove, rename... Fixed a few other cases of things not updated.
This commit is contained in:
@@ -198,11 +198,9 @@ function ReaderStatus:deleteFile(file, text_end_book)
|
||||
ok_text = _("Delete"),
|
||||
ok_callback = function()
|
||||
local FileManager = require("apps/filemanager/filemanager")
|
||||
local filemanagerutil = require("apps/filemanager/filemanagerutil")
|
||||
self.ui:onClose()
|
||||
FileManager:deleteFile(file)
|
||||
filemanagerutil.removeFileFromHistoryIfWanted(file)
|
||||
filemanagerutil.ensureLastFileExists()
|
||||
require("readhistory"):fileDeleted(file) -- (will update "lastfile")
|
||||
if FileManager.instance then
|
||||
FileManager.instance.file_chooser:refreshPath()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user