|
|
@ -180,15 +180,17 @@ end
|
|
|
|
-- we cannot do it in onSaveSettings() because getLastPercent() uses self.ui.document
|
|
|
|
-- we cannot do it in onSaveSettings() because getLastPercent() uses self.ui.document
|
|
|
|
function ReaderRolling:onCloseDocument()
|
|
|
|
function ReaderRolling:onCloseDocument()
|
|
|
|
self.ui.doc_settings:saveSetting("percent_finished", self:getLastPercent())
|
|
|
|
self.ui.doc_settings:saveSetting("percent_finished", self:getLastPercent())
|
|
|
|
-- also checks if DOM is coherent with styles; if not, invalidate the
|
|
|
|
local cache_file_path = self.ui.document:getCacheFilePath() -- nil if no cache file
|
|
|
|
-- cache, so a new DOM is built on next opening
|
|
|
|
self.ui.doc_settings:saveSetting("cache_file_path", cache_file_path)
|
|
|
|
if self.ui.document:isBuiltDomStale() then
|
|
|
|
if self.ui.document:hasCacheFile() then
|
|
|
|
if self.ui.document:hasCacheFile() then
|
|
|
|
-- also checks if DOM is coherent with styles; if not, invalidate the
|
|
|
|
|
|
|
|
-- cache, so a new DOM is built on next opening
|
|
|
|
|
|
|
|
if self.ui.document:isBuiltDomStale() then
|
|
|
|
logger.dbg("cre DOM may not be in sync with styles, invalidating cache file for a full reload at next opening")
|
|
|
|
logger.dbg("cre DOM may not be in sync with styles, invalidating cache file for a full reload at next opening")
|
|
|
|
self.ui.document:invalidateCacheFile()
|
|
|
|
self.ui.document:invalidateCacheFile()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
logger.dbg("cre cache used:", self.ui.document:getCacheFilePath() or "none")
|
|
|
|
logger.dbg("cre cache used:", cache_file_path or "none")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ReaderRolling:onCheckDomStyleCoherence()
|
|
|
|
function ReaderRolling:onCheckDomStyleCoherence()
|
|
|
|