From 1982e1154f2e42a58658ab34969572cc2c29c9e9 Mon Sep 17 00:00:00 2001 From: Paulo Matias Date: Wed, 22 Jan 2014 16:23:23 -0200 Subject: [PATCH] Refresh current path in filemanager after file operation This behavior is more consistent when e.g. a file is moved to ".." --- frontend/apps/filemanager/filemanager.lua | 4 ++-- frontend/ui/widget/filechooser.lua | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/apps/filemanager/filemanager.lua b/frontend/apps/filemanager/filemanager.lua index 94846091e..5447ed04a 100644 --- a/frontend/apps/filemanager/filemanager.lua +++ b/frontend/apps/filemanager/filemanager.lua @@ -92,7 +92,7 @@ function FileManager:init() enabled = fileManager.clipboard and true or false, callback = function() pasteHere(file) - self:changeToPath(util.realpath(file):match("(.*/)")) + self:refreshPath() UIManager:close(self.file_dialog) end, }, @@ -110,7 +110,7 @@ function FileManager:init() callback = function() local path = util.realpath(file) deleteFile(file) - self:changeToPath(path:match("(.*/)")) + self:refreshPath() UIManager:close(self.file_dialog) end, }, diff --git a/frontend/ui/widget/filechooser.lua b/frontend/ui/widget/filechooser.lua index 8cd17a57f..eac2c8cb5 100644 --- a/frontend/ui/widget/filechooser.lua +++ b/frontend/ui/widget/filechooser.lua @@ -63,7 +63,11 @@ end function FileChooser:changeToPath(path) path = util.realpath(path) self.path = path - self:swithItemTable(nil, self:genItemTableFromPath(path)) + self:refreshPath() +end + +function FileChooser:refreshPath() + self:swithItemTable(nil, self:genItemTableFromPath(self.path)) end function FileChooser:toggleHiddenFiles()