BookInformation: speedup getting EPUB metadata/cover (#3767)

coverbrowser: also plug optimised callback to the right
button ("Book information" was shifted when "Open with..."
was added)
pull/3769/head
poire-z 6 years ago committed by GitHub
parent bc1eefb20b
commit 0fde66c2c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -103,7 +103,7 @@ function BookInfo:show(file, book_props)
local loaded = true
local pages
if document.loadDocument then -- CreDocument
if not document:loadDocument() then
if not document:loadDocument(false) then -- load only metadata
-- failed loading, calling other methods would segfault
loaded = false
end
@ -173,6 +173,9 @@ function BookInfo:show(file, book_props)
local widget
local document = DocumentRegistry:openDocument(file)
if document then
if document.loadDocument then -- CreDocument
document:loadDocument(false) -- load only metadata
end
local cover_bb = document:getCoverPageImage()
if cover_bb then
widget = ImageViewer:new{

@ -234,7 +234,7 @@ function CoverMenu:updateItems(select_number)
UIManager:close(self.file_dialog)
-- Replace Book information callback to use directly our bookinfo
orig_buttons[4][2].callback = function()
orig_buttons[4][3].callback = function()
FileManagerBookInfo:show(file, bookinfo)
UIManager:close(self.file_dialog)
end

Loading…
Cancel
Save