[fix] Allow default FM rotation on init when `Keep FM rotation` is disabled (#6348)

reviewable/pr6350/r1
yparitcher 4 years ago committed by GitHub
parent 8a61e70fad
commit 8f2399caa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -70,10 +70,12 @@ function FileManager:onSetRotationMode(rotation)
return true
end
function FileManager:setRotationMode()
-- init should be set to True when starting the FM for the first time
-- (not coming from the reader). This allows the default to be properly set.
function FileManager:setRotationMode(init)
local locked = G_reader_settings:readSetting("lock_rotation")
local rotation_mode = G_reader_settings:readSetting("fm_rotation_mode") or 0
if locked then
local rotation_mode = G_reader_settings:readSetting("fm_rotation_mode") or Screen.ORIENTATION_PORTRAIT
if locked or init then
self:onSetRotationMode(rotation_mode)
end
end

@ -277,6 +277,7 @@ if ARGV[argidx] and ARGV[argidx] ~= "" then
local home_dir =
G_reader_settings:readSetting("home_dir") or ARGV[argidx]
UIManager:nextTick(function()
FileManager:setRotationMode(true)
FileManager:showFiles(home_dir)
end)
-- always open history on top of filemanager so closing history

Loading…
Cancel
Save