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

Friedrich W. H. Kossebau kossebau at kde.org
Fri Jun 29 05:26:40 BST 2012


Hi Thorsten,

Am Freitag, 29. Juni 2012, 06:20:19 schrieb Thorsten Zachmann:
> 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.

Good, will have a look at ctester, thanks for the pointer.

> 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.

True (unless the first page has the list of contents or a page number). Will 
keep that in the back of my mind.

Cheers
Friedrich



More information about the calligra-devel mailing list