How to know when a KoDocument is ready for generatePreview(...)?

Thorsten Zachmann t.zachmann at zagge.de
Fri Jun 29 05:20:19 BST 2012


Hello Friedrich,

On Thursday 28 June 2012 23:23:19 Friedrich W. H. Kossebau wrote:
> Hi,
> 
> I am currently restoring the functionality of the Calligra thumbnail
> generator in tools/thumbnail. Works fine on a first look (so I pushed a
> review request in https://git.reviewboard.kde.org/r/105373/ ), but on a
> closer look there are some issues.
> E.g. just waiting for the signal completed() is not enough, seems the
> layouting is still under process, so generating at that time the generated
> preview is garbage.
> 
> KoDocument has no signal like layoutingDone(). So am I right that I need to
> cast to the individual subclasses? But what would be proper signals for each
> of them?
> 
> KWDocument could be done with pageSetupChanged().
> KoPADocument?
> Calligra::Sheets::Doc with updateView()?
> The others?
> 
> Or could we introduce a general signal documentLayoutCompleted()? Can there
> be a signal with such a semantics at all for all current Calligra
> documents? Would there be other usecases besides creating snapshots of the
> rendering?

cstester has the same problematic. However it nearly works there. I say nearly 
as for Calligra Words it does not work 100% correct. Sometimes some images are 
not painted correctly. For kopageapp applications calling the thumbnail 
function as cstester does gives you what you what without any problems.

Just a thought for the screenshot of the first page not everything needs to be 
layouted. It might not be 100% correct if there are page numbers but I guess 
otherwise it could be quite long for a big document to create a thumbnail of 
the first page only.

Thorsten



More information about the calligra-devel mailing list