Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go Big or Go Home! #5163

Merged
merged 4 commits into from Aug 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 28 additions & 2 deletions frontend/apps/filemanager/filemanager.lua
Expand Up @@ -560,9 +560,35 @@ end
function FileManager:goHome()
local home_dir = G_reader_settings:readSetting("home_dir")
if home_dir then
self.file_chooser:changeToPath(home_dir)
-- Jump to the first page if we're already home
if self.file_chooser.path and home_dir == self.file_chooser.path then
self.file_chooser:onGotoPage(1)
else
self.file_chooser:changeToPath(home_dir)
end
else
self:setHome()
-- Try some sane defaults, depending on platform
if Device:isKindle() then
home_dir = "/mnt/us"
elseif Device:isKobo() then
home_dir = "/mnt/onboard"
elseif Device:isPocketBook() then
home_dir = "/mnt/ext1"
elseif Device:isCervantes() then
home_dir = "/mnt/public"
elseif Device:isAndroid() then
home_dir = "/sdcard"
end

if home_dir then
if self.file_chooser.path and home_dir == self.file_chooser.path then
self.file_chooser:onGotoPage(1)
else
self.file_chooser:changeToPath(home_dir)
end
else
self:setHome()
end
end
return true
end
Expand Down