CoverBrowser: speedup "View full size cover"
It was doing a full document load to get the cover. It now does the faster "only metadata" load. Also move the trick of setting a default font in CreDocument, so that all callers of document:loadDocument(false) benefit from it. Prevent crash when no cover image is available (even if the cache says it has one, the file may have been updated and doesn't have it anymore).
This commit is contained in:
1 parent
c060595580
commit
17f07e755f
3 files changed
+36
-16
No files matched your search
@@ -177,6 +177,11 @@ function CreDocument:loadDocument(full_document)
|
||||
if not self._loaded then
|
||||
local only_metadata = full_document == false
|
||||
logger.dbg("CreDocument: loading document...")
|
||||
if only_metadata then
|
||||
-- Setting a default font before loading document
|
||||
-- actually do prevent some crashes
|
||||
self:setFontFace(self.default_font)
|
||||
end
|
||||
if self._document:loadDocument(self.file, only_metadata) then
|
||||
self._loaded = true
|
||||
logger.dbg("CreDocument: loading done.")
|
||||
|
||||
Reference in new issue
Block a user