10#include <klocalizedstring.h>
46 QString name = QFileInfo(path).fileName();
47 QString fileName = !name.isEmpty() ? name :
path;
50 return (layerName.isEmpty() || layerName == i18nc(
"Name for the bottom-most layer in the layerstack",
"Background"))
63 KisLayerSP currentActiveLayer = view->activeLayer();
65 if (currentActiveLayer) {
66 parent = currentActiveLayer->
parent();
69 if (parent.isNull()) {
70 parent = view->image()->rootLayer();
74 adapter.
addNode(newLayer, parent, currentActiveLayer);
80 KisLayerSP currentActiveLayer = view->activeLayer();
82 if (currentActiveLayer) {
83 parent = currentActiveLayer->
parent();
86 if (parent.isNull()) {
87 parent = view->image()->rootLayer();
91 adapter.
addNode(shapeLayer, parent, currentActiveLayer);
116 if (importedImage && importedImage->
bounds().isValid()) {
140 Q_FOREACH (
KoShape *shape, imported->shapes()) {
const quint8 OPACITY_OPAQUE_U8
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
bool convertToImageColorspaceOnImport(bool defaultValue=false) const
KisShapeController * shapeController
bool openPath(const QString &path, OpenFlags flags=None)
openPath Open a Path
KisGroupLayerSP rootLayer() const
const KoColorSpace * colorSpace() const
KisPaintDeviceSP projection() const
QRect bounds() const override
~KisImportCatcher() override
void slotLoadingFinished()
static void adaptClipToImageColorSpace(KisPaintDeviceSP dev, KisImageSP image)
KisImportCatcher(const QString &url, KisViewManager *view, const QString &layerType)
int numLayersImported() const
void addNode(KisNodeSP node, KisNodeSP parent, KisNodeSP aboveThis, KisImageLayerAddCommand::Flags flags=KisImageLayerAddCommand::DoRedoUpdates|KisImageLayerAddCommand::DoUndoUpdates)
KisNodeSP createNode(const QString &nodeType, bool quiet=false, KisPaintDeviceSP copyFrom=0)
const KoColorSpace * colorSpace() const
void convertTo(const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags(), KUndo2Command *parentCommand=nullptr, KoUpdater *progressUpdater=nullptr)
static KisPart * instance()
KisDocument * createDocument() const
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
virtual KisPaintDeviceSP projection() const =0
QString prettyLayerName(QString layerName) const
void importShapeLayer(KisShapeLayerSP shapeLayer)
void importAsPaintLayer(KisPaintDeviceSP device, QString layerName)
KisNodeSP firstChild() const
QList< KisNodeSP > childNodes(const QStringList &nodeTypes, const KoProperties &properties) const