void KisDummiesFacadeBase::setImage(KisImageWSP image) { if (m_d->image) { emit sigActivateNode(0); m_d->image->disconnect(this); KisNodeDummy *rootDummy = this->rootDummy(); if(rootDummy) { slotRemoveNode(rootDummy->node()); } } m_d->image = image; if (image) { slotNodeAdded(image->root()); connect(image, SIGNAL(sigNodeAddedAsync(KisNodeSP)), SLOT(slotNodeAdded(KisNodeSP)), Qt::DirectConnection); connect(image, SIGNAL(sigRemoveNodeAsync(KisNodeSP)), SLOT(slotRemoveNode(KisNodeSP)), Qt::DirectConnection); connect(image, SIGNAL(sigLayersChangedAsync()), SLOT(slotLayersChanged()), Qt::DirectConnection); connect(image, SIGNAL(sigNodeChanged(KisNodeSP)), SLOT(slotNodeChanged(KisNodeSP))); connect(image, SIGNAL(sigNodeAddedAsync(KisNodeSP)), SLOT(slotNodeActivationRequested(KisNodeSP)), Qt::AutoConnection); emit sigActivateNode(findFirstLayer(image->root())); } }
KisImageSignalRouter::KisImageSignalRouter(KisImageWSP image) : m_image(image) { connect(this, SIGNAL(sigNotification(KisImageSignalType)), SLOT(slotNotification(KisImageSignalType))); CONNECT_TO_IMAGE(sigImageModified()); CONNECT_TO_IMAGE(sigSizeChanged(const QPointF&, const QPointF&)); CONNECT_TO_IMAGE(sigProfileChanged(const KoColorProfile*)); CONNECT_TO_IMAGE(sigColorSpaceChanged(const KoColorSpace*)); CONNECT_TO_IMAGE(sigResolutionChanged(double, double)); CONNECT_TO_IMAGE(sigNodeChanged(KisNodeSP)); CONNECT_TO_IMAGE(sigNodeAddedAsync(KisNodeSP)); CONNECT_TO_IMAGE(sigRemoveNodeAsync(KisNodeSP)); CONNECT_TO_IMAGE(sigLayersChangedAsync()); }