mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Bugfix for deleting a directory:
After a directory is deleted it is still shown in the filemanager list, so you can accidentally delete another directory as all the pointers after the previously deleted entry are wrong (shifted by one).
This commit is contained in:
@@ -361,16 +361,16 @@ function FileChooser:addAllCommands()
|
||||
local pos = self.perpage*(self.page-1)+self.current
|
||||
local folder = self.dirs[pos]
|
||||
if folder == ".." then
|
||||
showInfoMsgWithDelay(".. cannot be deleted! ",2000,1)
|
||||
showInfoMsgWithDelay(".. cannot be deleted! ",1500,1)
|
||||
elseif folder then
|
||||
InfoMessage:show("Press \'Y\' to confirm",0)
|
||||
if self:ReturnKey() == KEY_Y then
|
||||
if lfs.rmdir(self.path.."/"..folder) then
|
||||
table.remove(self.dirs, offset)
|
||||
self.items = self.items - 1
|
||||
self.current = self.current - 1
|
||||
self:setPath(self.path)
|
||||
else
|
||||
showInfoMsgWithDelay("Cannot be deleted!",2000,1)
|
||||
showInfoMsgWithDelay("Cannot be deleted!",1500,1)
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user