mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add: UniReader:initGlobalSettings()
Use this method to read settings that may shared among all readers. For instance, pan_overlap_vertical
This commit is contained in:
@@ -119,6 +119,8 @@ if r_cfont ~=nil then
|
||||
FontChooser.cfont = r_cfont
|
||||
end
|
||||
|
||||
-- initialize global settings shared among all readers
|
||||
UniReader:initGlobalSettings(reader_settings)
|
||||
-- initialize specific readers
|
||||
PDFReader:init()
|
||||
DJVUReader:init()
|
||||
|
||||
@@ -117,6 +117,13 @@ function UniReader:loadSettings(filename)
|
||||
return false
|
||||
end
|
||||
|
||||
function UniReader:initGlobalSettings(settings)
|
||||
local pan_overlap_vertical = settings:readsetting("pan_overlap_vertical")
|
||||
if pan_overlap_vertical then
|
||||
self.pan_overlap_vertical = pan_overlap_vertical
|
||||
end
|
||||
end
|
||||
|
||||
-- guarantee that we have enough memory in cache
|
||||
function UniReader:cacheclaim(size)
|
||||
if(size > self.cache_max_memsize) then
|
||||
|
||||
Reference in New Issue
Block a user