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:
Qingping Hou
2012-03-07 18:16:46 +08:00
parent f9ba833568
commit f79ae48de8
2 changed files with 9 additions and 0 deletions

View File

@@ -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()

View File

@@ -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