Almost done with setDirty

Boudewijn Rempt boud at valdyas.org
Mon Feb 20 16:59:37 CET 2006


I'm alnmost done with the conversion from KisImage::notify() to KisLayer::setDirty. 
Most things work, and now we don't have both notify() and setDirty, things are cleaner,
but I've got one problem: sigImageUpdated, which is connected to  in several places 
to keep track of whether (and where) the image was changed by user action:

./ui/kis_layerbox.cc:        connect(img, SIGNAL(sigImageUpdated(const QRect&)), this, SLOT(slotImageUpdated()));
./ui/kis_birdeye_box.cc:        connect(m_image, SIGNAL(sigImageUpdated(const QRect&)), SLOT(slotImageUpdated(const QRect&)));
./ui/kis_birdeye_box.cc:        connect(m_image, SIGNAL(sigImageUpdated(const QRect&)), SLOT(slotImageUpdated(const QRect&)));
./ui/kis_opengl_image_context.cc:    connect(m_image, SIGNAL(sigImageUpdated(const QRect&)),
./ui/kis_view.cc:            connect(m_image, SIGNAL(sigImageUpdated(const QRect&)),
./plugins/viewplugins/histogram_docker/kis_imagerasteredcache.cc:    connect(img, SIGNAL(sigImageUpdated(const QRect&)),

I currently emit this signal whenever the setDirty is called on the rootlayer:

./core/kis_image.cc:        connect(m_rootLayer, SIGNAL(sigDirty(const QRect &)), this, SIGNAL(sigImageUpdated( const QRect& )));
./core/kis_image.cc:    connect(m_rootLayer, SIGNAL(sigDirty(const QRect &)), this, SIGNAL(sigImageUpdated( const QRect& )));
./core/kis_image.cc:    disconnect(oldRootLayer, SIGNAL(sigDirty(const QRect &)), this, SIGNAL(sigImageUpdated( const QRect& )));
./core/kis_image.cc:    connect(m_rootLayer, SIGNAL(sigDirty(const QRect &)), this, SIGNAL(sigImageUpdated( const QRect& )));

This has the same problem we had, though: every setDirty (potentially) leads to 
a recomposite action, if one of the places that sigImageUpdated is connected
to asks for the projection of the root layer.

I'm trying to decide whether we had better introduce a second 
call -- something like "doneWithTheImageNotifyEveryone"
that should be called after a set of setDirty()'s has been called,
or introduce a timer (possibly with a restart whenever a sigDirty
is emitted within the wait period). Or maybe something else.

The thing is:

* we want to be able to mess with layers a lot without getting things recomposited
* when done, the rest of Krita must be notified that we're done
* or we must redo the layerbox/birdeyebox/opengl image context/

I will commit now, since what I've got isn't worse than what we had before, but I'll keep
working on it. And suggestions are very welcome.

-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20060220/2b0192de/attachment.pgp 


More information about the kimageshop mailing list