gamutmask_dock.cpp (krita-5.1.3.tar.xz) | : | gamutmask_dock.cpp (krita-5.1.4.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 151 | skipping to change at line 151 | |||
m_maskDocument = KisPart::instance()->createDocument(); | m_maskDocument = KisPart::instance()->createDocument(); | |||
KisPart::instance()->addDocument(m_maskDocument); | KisPart::instance()->addDocument(m_maskDocument); | |||
m_maskDocument->openPath(maskTemplateFile, KisDocument::DontAddToRecent); | m_maskDocument->openPath(maskTemplateFile, KisDocument::DontAddToRecent); | |||
// template document needs a proper autogenerated filename, | // template document needs a proper autogenerated filename, | |||
// to avoid collision with other documents, | // to avoid collision with other documents, | |||
// otherwise bugs happen when slotDocumentRemoved is called | // otherwise bugs happen when slotDocumentRemoved is called | |||
// (e.g. user closes another view, the template stays open, but the edit ope ration is canceled) | // (e.g. user closes another view, the template stays open, but the edit ope ration is canceled) | |||
m_maskDocument->setInfiniteAutoSaveInterval(); | m_maskDocument->setInfiniteAutoSaveInterval(); | |||
QString maskPath = QString("%1%2%3_%4.kra") | QString maskPath = | |||
.arg(QDir::tempPath()) | QString("%1%2%3_%4.kra") | |||
.arg('/') | .arg(QDir::tempPath(), "/", "GamutMaskTemplate", QString::number(std | |||
.arg("GamutMaskTemplate") | ::time(nullptr))); | |||
.arg(std::time(nullptr)); | ||||
m_maskDocument->setPath(maskPath); | m_maskDocument->setPath(maskPath); | |||
m_maskDocument->setLocalFilePath(maskPath); | m_maskDocument->setLocalFilePath(maskPath); | |||
KisShapeLayerSP shapeLayer = getShapeLayer(); | KisShapeLayerSP shapeLayer = getShapeLayer(); | |||
// pass only copies of shapes to the layer, | // pass only copies of shapes to the layer, | |||
// so the originals don't disappear from the mask later | // so the originals don't disappear from the mask later | |||
for (KoShape *shape: m_selectedMask->koShapes()) { | for (KoShape *shape: m_selectedMask->koShapes()) { | |||
KoShape* newShape = shape->cloneShape(); | KoShape* newShape = shape->cloneShape(); | |||
newShape->setStroke(KoShapeStrokeModelSP()); | newShape->setStroke(KoShapeStrokeModelSP()); | |||
End of changes. 1 change blocks. | ||||
5 lines changed or deleted | 4 lines changed or added |