This small helper class takes an url and an image; tries to import the image at the url and shove the layers of the imported image into the first image after loading is done. This is a separate class because loading can be asynchronous.
Caveat: this class calls "delete this", which means that you new it and then never touch it again. Thank you very much.
Definition at line 26 of file kis_import_catcher.h.
| void KisImportCatcher::slotLoadingFinished |
( |
| ) |
|
|
privateslot |
The layers are added on the top of the active layer, so we should reverse their order.
Definition at line 111 of file kis_import_catcher.cc.
112{
115
116 if (importedImage && importedImage->
bounds().isValid()) {
119 list << "KisLayer";
121
123
129 while (node) {
130
131
137 }
138 }
145
147
152 }
155 }
156 else {
160 }
161 }
162
164}
const quint8 OPACITY_OPAQUE_U8
KisShapeController * shapeController
KisGroupLayerSP rootLayer() const
KisPaintDeviceSP projection() const
QRect bounds() const override
static void adaptClipToImageColorSpace(KisPaintDeviceSP dev, KisImageSP image)
KisNodeSP createNode(const QString &nodeType, bool quiet=false, KisPaintDeviceSP copyFrom=0)
KisDocument * document() const
KisNodeManager * nodeManager() const
The node manager handles everything about nodes.
KisImageWSP image() const
Return the image this view is displaying.
void addShape(KoShape *shape)
QTransform absoluteTransformation() const
void setTransformation(const QTransform &matrix)
virtual KoShape * cloneShape() const
creates a deep copy of the shape or shape's subtree
const char * name(StandardAction id)
virtual KisPaintDeviceSP projection() const =0
QString prettyLayerName(QString layerName) const
void importShapeLayer(KisShapeLayerSP shapeLayer)
void importAsPaintLayer(KisPaintDeviceSP device, QString layerName)
KisNodeSP prevSibling() const
KisNodeSP firstChild() const
quint32 childCount() const
KisNodeSP lastChild() const
References KoShape::absoluteTransformation(), adaptClipToImageColorSpace(), KoShapeContainer::addShape(), KisImage::bounds(), KisNode::childCount(), KoShape::cloneShape(), KisNodeManager::createNode(), KisSharedPtr< T >::data(), KisWeakSharedPtr< T >::data(), deleteMyself(), KisImportCatcher::Private::doc, KisViewManager::document(), KisNode::firstChild(), KisDocument::image, KisViewManager::image(), KisImportCatcher::Private::importAsPaintLayer(), KisImportCatcher::Private::importShapeLayer(), KisNode::lastChild(), KisImportCatcher::Private::layerType, m_d, KisBaseNode::name(), KisViewManager::nodeManager(), KisImportCatcher::Private::numLayersImported, OPACITY_OPAQUE_U8, KisImportCatcher::Private::prettyLayerName(), KisNode::prevSibling(), KisImage::projection(), KisBaseNode::projection(), KisImage::rootLayer(), KoShape::setTransformation(), KisDocument::shapeController, KisImportCatcher::Private::view, and KisImage::waitForDone().