cre: default to enable crengine call cache

Also reset cache when calling :enableInternalHistory(), as it solves
screen orientation change unit tests failures (although there is no
issue in regular use of the app).
reviewable/pr5803/r1
poire-z 4 years ago
parent 6d2cada96e
commit 1b55baf437

@ -442,17 +442,17 @@ function FileManagerMenu:setUpdateItemTable()
}) })
table.insert(self.menu_items.developer_options.sub_item_table, { table.insert(self.menu_items.developer_options.sub_item_table, {
text_func = function() text_func = function()
if G_reader_settings:isTrue("use_cre_call_cache") if G_reader_settings:nilOrTrue("use_cre_call_cache")
and G_reader_settings:isTrue("use_cre_call_cache_log_stats") then and G_reader_settings:isTrue("use_cre_call_cache_log_stats") then
return _("Enable CRE call cache (with stats)") return _("Enable CRE call cache (with stats)")
end end
return _("Enable CRE call cache") return _("Enable CRE call cache")
end, end,
checked_func = function() checked_func = function()
return G_reader_settings:isTrue("use_cre_call_cache") return G_reader_settings:nilOrTrue("use_cre_call_cache")
end, end,
callback = function() callback = function()
G_reader_settings:flipNilOrFalse("use_cre_call_cache") G_reader_settings:flipNilOrTrue("use_cre_call_cache")
-- No need to show "This will take effect on next CRE book opening." -- No need to show "This will take effect on next CRE book opening."
-- as this menu is only accessible from file browser -- as this menu is only accessible from file browser
end, end,

@ -888,9 +888,11 @@ end
-- either globally, or per page/pos for those whose result may depend on -- either globally, or per page/pos for those whose result may depend on
-- current page number or y-position. -- current page number or y-position.
function CreDocument:setupCallCache() function CreDocument:setupCallCache()
if not G_reader_settings:isTrue("use_cre_call_cache") then if not G_reader_settings:nilOrTrue("use_cre_call_cache") then
return -- call cache disabled logger.dbg("CreDocument: not using cre call cache")
return
end end
logger.dbg("CreDocument: using cre call cache")
local do_stats = G_reader_settings:isTrue("use_cre_call_cache_log_stats") local do_stats = G_reader_settings:isTrue("use_cre_call_cache_log_stats")
-- Tune these when debugging -- Tune these when debugging
local do_stats_include_not_cached = false local do_stats_include_not_cached = false
@ -1105,6 +1107,7 @@ function CreDocument:setupCallCache()
elseif name:sub(1,3) == "set" then add_reset = true elseif name:sub(1,3) == "set" then add_reset = true
elseif name:sub(1,6) == "toggle" then add_reset = true elseif name:sub(1,6) == "toggle" then add_reset = true
elseif name:sub(1,6) == "update" then add_reset = true elseif name:sub(1,6) == "update" then add_reset = true
elseif name:sub(1,6) == "enable" then add_reset = true
elseif name == "zoomFont" then add_reset = true -- not used by koreader elseif name == "zoomFont" then add_reset = true -- not used by koreader
-- These may have crengine do native highlight or unhighlight -- These may have crengine do native highlight or unhighlight

Loading…
Cancel
Save