Commit 7645169b authored by Dmitry Kazakov's avatar Dmitry Kazakov

Remove the usage of ModifiedSignal from KisProcessingApplicator

Now this signal is emitted by the undo stack itself, there is no
need to emit that manually.
parent 029deeef
......@@ -14,7 +14,6 @@
enum KisImageSignalTypeEnum {
LayersChangedSignal,
ModifiedSignal,
ModifiedWithoutUndoSignal,
SizeChangedSignal,
ProfileChangedSignal,
......
......@@ -774,7 +774,6 @@ void KisImage::resizeImageImpl(const QRect& newRect, bool cropLayers)
KisImageSignalVector emitSignals;
emitSignals << ComplexSizeChangedSignal(newRect, newRect.size());
emitSignals << ModifiedSignal;
KisCropSavedExtraData *extraData =
new KisCropSavedExtraData(cropLayers ?
......@@ -865,7 +864,6 @@ void KisImage::cropNode(KisNodeSP node, const QRect& newRect, const bool activeF
kundo2_i18n("Crop Mask");
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
KisCropSavedExtraData *extraData =
new KisCropSavedExtraData(KisCropSavedExtraData::CROP_LAYER,
......@@ -898,7 +896,6 @@ void KisImage::scaleImage(const QSize &size, qreal xres, qreal yres, KisFilterSt
KisImageSignalVector emitSignals;
if (resolutionChanged) emitSignals << ResolutionChangedSignal;
if (sizeChanged) emitSignals << ComplexSizeChangedSignal(bounds(), size);
emitSignals << ModifiedSignal;
KUndo2MagicString actionName = sizeChanged ?
kundo2_i18n("Scale Image") :
......@@ -951,7 +948,6 @@ void KisImage::scaleNode(KisNodeSP node, const QPointF &center, qreal scaleX, qr
{
KUndo2MagicString actionName(kundo2_i18n("Scale Layer"));
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
QPointF offset;
{
......@@ -1036,7 +1032,6 @@ void KisImage::rotateImpl(const KUndo2MagicString &actionName,
// These signals will be emitted after processing is done
KisImageSignalVector emitSignals;
if (sizeChanged) emitSignals << ComplexSizeChangedSignal(baseBounds, newSize);
emitSignals << ModifiedSignal;
// These flags determine whether updates are transferred to the UI during processing
KisProcessingApplicator::ProcessingFlags signalFlags =
......@@ -1127,7 +1122,6 @@ void KisImage::shearImpl(const KUndo2MagicString &actionName,
KisImageSignalVector emitSignals;
if (resizeImage) emitSignals << ComplexSizeChangedSignal(baseBounds, newSize);
emitSignals << ModifiedSignal;
KisProcessingApplicator::ProcessingFlags signalFlags =
KisProcessingApplicator::RECURSIVE;
......@@ -1195,7 +1189,6 @@ void KisImage::convertLayerColorSpace(KisNodeSP node,
kundo2_i18n("Convert Layer Color Space");
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
KisProcessingApplicator applicator(this, node,
KisProcessingApplicator::RECURSIVE,
......@@ -1249,7 +1242,6 @@ void KisImage::KisImagePrivate::convertImageColorSpaceImpl(const KoColorSpace *d
KisImageSignalVector emitSignals;
emitSignals << ColorSpaceChangedSignal;
emitSignals << ModifiedSignal;
KisProcessingApplicator applicator(q, this->rootLayer,
KisProcessingApplicator::RECURSIVE |
......@@ -1314,7 +1306,6 @@ bool KisImage::assignLayerProfile(KisNodeSP node, const KoColorProfile *profile)
KUndo2MagicString actionName = kundo2_i18n("Assign Profile to Layer");
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
const KoColorSpace *dstColorSpace = KoColorSpaceRegistry::instance()->colorSpace(colorSpace()->colorModelId().id(), colorSpace()->colorDepthId().id(), profile);
if (!dstColorSpace) return false;
......@@ -1357,7 +1348,6 @@ bool KisImage::assignImageProfile(const KoColorProfile *profile, bool blockAllUp
KisImageSignalVector emitSignals;
emitSignals << ProfileChangedSignal;
emitSignals << ModifiedSignal;
const KoColorSpace *dstColorSpace = KoColorSpaceRegistry::instance()->colorSpace(colorSpace()->colorModelId().id(), colorSpace()->colorDepthId().id(), profile);
if (!dstColorSpace) return false;
......@@ -1529,7 +1519,7 @@ void KisImage::flattenLayer(KisLayerSP layer)
void KisImage::setModifiedWithoutUndo()
{
m_d->signalRouter.emitNotification(ModifiedWithoutUndoSignal);
m_d->signalRouter.emitNotification(ModifiedSignal);
emit sigImageModified();
}
QImage KisImage::convertToQImage(QRect imageRect,
......@@ -2375,7 +2365,7 @@ void KisImage::setWrapAroundModePermitted(bool value)
KisProcessingApplicator applicator(this, root(),
KisProcessingApplicator::RECURSIVE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
kundo2_i18n("Crop Selections"));
KisProcessingVisitorSP visitor =
......
......@@ -62,7 +62,7 @@ KisImageSignalRouter::~KisImageSignalRouter()
void KisImageSignalRouter::emitImageModifiedNotification()
{
emitNotification(ModifiedSignal);
emit sigImageModified();
}
void KisImageSignalRouter::emitNotifications(KisImageSignalVector notifications)
......@@ -149,9 +149,6 @@ void KisImageSignalRouter::slotNotification(KisImageSignalType type)
image->invalidateAllFrames();
emit sigLayersChangedAsync();
break;
case ModifiedSignal:
emit sigImageModified();
break;
case ModifiedWithoutUndoSignal:
emit sigImageModifiedWithoutUndo();
break;
......
......@@ -986,8 +986,6 @@ namespace KisLayerUtils {
}
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
KisProcessingApplicator applicator(image, 0,
KisProcessingApplicator::NONE,
emitSignals,
......@@ -1284,8 +1282,6 @@ namespace KisLayerUtils {
void changeImageDefaultProjectionColor(KisImageSP image, const KoColor &color)
{
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
KisProcessingApplicator applicator(image,
image->root(),
KisProcessingApplicator::RECURSIVE,
......@@ -1341,7 +1337,6 @@ namespace KisLayerUtils {
(!flattenSingleLayer && mergedNodes.size() == 1)) return;
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
emitSignals << ComplexNodeReselectionSignal(KisNodeSP(), KisNodeList(), KisNodeSP(), mergedNodes);
......@@ -1533,7 +1528,6 @@ namespace KisLayerUtils {
KIS_ASSERT_RECOVER(parentLayer) { return 0; }
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
KisProcessingApplicator applicator(image, 0,
KisProcessingApplicator::NONE,
......
......@@ -411,7 +411,7 @@ void KisProcessingApplicator::runSingleCommandStroke(KisImageSP image, KUndo2Com
{
KisProcessingApplicator applicator(image, 0,
KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
cmd->text());
applicator.applyCommand(cmd, sequentiality, exclusivity);
applicator.end();
......
......@@ -42,7 +42,6 @@ void KisImageSignalRouterTest::testSignalForwarding()
{
checkNotification(LayersChangedSignal, SIGNAL(sigLayersChangedAsync()));
checkNotification(ModifiedSignal, SIGNAL(sigImageModified()));
checkNotification(SizeChangedSignal, SIGNAL(sigSizeChanged(QPointF,QPointF)));
checkNotification(ComplexSizeChangedSignal(), SIGNAL(sigSizeChanged(QPointF,QPointF)));
// These cannot be checked because KoColorProfile and KoColorSpace are not registered metatypes,
......
......@@ -202,7 +202,7 @@ void KisFillActionFactory::run(const QString &fillSource, KisViewManager *view)
KisProcessingApplicator applicator(view->image(), node,
KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
kundo2_i18n("Flood Fill Layer"));
KisResourcesSnapshotSP resources =
......
......@@ -24,7 +24,7 @@ struct KisDlgChangeCloneSource::Private
, image(view->image())
, applicator(new KisProcessingApplicator(image, 0,
KisProcessingApplicator::NONE,
/* emitSignals = */ KisImageSignalVector() << ModifiedSignal,
/* emitSignals = */ KisImageSignalVector(),
kundo2_i18n("Change Clone Layers")))
, modified(false) {}
......
......@@ -661,7 +661,7 @@ KisNodeSP KisLayerManager::addAdjustmentLayer(KisNodeSP activeNode)
KisSelectionSP selection = m_view->selection();
KisProcessingApplicator applicator(image, 0, KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
kundo2_i18n("Add Layer"));
......@@ -714,7 +714,7 @@ KisNodeSP KisLayerManager::addGeneratorLayer(KisNodeSP activeNode)
KisSelectionSP selection = m_view->selection();
QColor currentForeground = m_view->canvasResourceProvider()->fgColor().toQColor();
KisProcessingApplicator applicator(image, 0, KisProcessingApplicator::NONE, KisImageSignalVector() << ModifiedSignal, kundo2_i18n("Add Layer"));
KisProcessingApplicator applicator(image, 0, KisProcessingApplicator::NONE, KisImageSignalVector(), kundo2_i18n("Add Layer"));
KisGeneratorLayerSP node = addGeneratorLayer(activeNode, QString(), nullptr, selection, &applicator);
......
......@@ -35,7 +35,7 @@ void KisNodeCommandsAdapter::applyOneCommandAsync(KUndo2Command *cmd, KisProcess
} else {
QScopedPointer<KisProcessingApplicator> localApplicator(
new KisProcessingApplicator(m_view->image(), 0, KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
cmd->text(),
0, cmd->id()));
localApplicator->applyCommand(cmd);
......
......@@ -684,7 +684,6 @@ KisNodeJugglerCompressed::KisNodeJugglerCompressed(const KUndo2MagicString &acti
{
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
m_d->applicator.reset(
new KisProcessingApplicator(m_d->image, 0,
......
......@@ -1146,7 +1146,6 @@ void KisNodeManager::mirrorNode(KisNodeSP node,
if (!canModifyLayer(node)) return;
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
KisProcessingApplicator applicator(m_d->view->image(), node,
KisProcessingApplicator::RECURSIVE,
......
......@@ -36,7 +36,6 @@ KisProcessingApplicator* KisOperation::beginAction(KisViewManager *view, const K
Q_ASSERT(image);
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
return new KisProcessingApplicator(image, 0,
KisProcessingApplicator::NONE,
......
......@@ -21,7 +21,7 @@ void KisSelectionDecorationTest::testConcurrentSelectionFetches()
KisProcessingApplicator applicator(image,
0 /* we need no automatic updates */,
KisProcessingApplicator::SUPPORTS_WRAPAROUND_MODE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
kundo2_noi18n("test stroke"));
......
......@@ -65,7 +65,7 @@ void KisSelectionToolHelper::selectPixelSelection(KisPixelSelectionSP selection,
KisProcessingApplicator applicator(view->image(),
0 /* we need no automatic updates */,
KisProcessingApplicator::SUPPORTS_WRAPAROUND_MODE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
m_name);
selectPixelSelection(applicator, selection, action);
......@@ -181,7 +181,7 @@ void KisSelectionToolHelper::addSelectionShapes(QList< KoShape* > shapes, Select
KisProcessingApplicator applicator(view->image(),
0 /* we need no automatic updates */,
KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
m_name);
applicator.applyCommand(new LazyInitGlobalSelection(view));
......
......@@ -947,7 +947,7 @@ void LayerBox::slotEditGlobalSelection(bool showSelections)
if (showSelections && !globalSelectionMask) {
KisProcessingApplicator applicator(m_image, 0,
KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
kundo2_i18n("Quick Selection Mask"));
applicator.applyCommand(
......@@ -969,7 +969,7 @@ void LayerBox::slotEditGlobalSelection(bool showSelections)
KisProcessingApplicator applicator(m_image, 0,
KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
kundo2_i18n("Cancel Quick Selection Mask"));
applicator.applyCommand(new KisSetGlobalSelectionCommand(m_image, 0), KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::EXCLUSIVE);
applicator.end();
......
......@@ -202,7 +202,7 @@ void DlgClonesArray::reapplyClones()
m_applicator =
new KisProcessingApplicator(image, 0,
KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal);
KisImageSignalVector());
int columnXOffset = m_page->columnXOffset->value();
int columnYOffset = m_page->columnYOffset->value();
......
......@@ -96,7 +96,6 @@ void OffsetImage::slotOffsetLayer()
void OffsetImage::offsetImpl(const KUndo2MagicString& actionName, KisNodeSP node, const QPoint& offsetPoint)
{
KisImageSignalVector emitSignals;
emitSignals << ModifiedSignal;
KisProcessingApplicator applicator(viewManager()->image(), node,
KisProcessingApplicator::RECURSIVE,
......
......@@ -41,7 +41,7 @@ void KisQmicApplicator::apply()
cancel();
KisImageSignalVector emitSignals;
emitSignals << ComplexSizeChangedSignal() << ModifiedSignal;
emitSignals << ComplexSizeChangedSignal();
m_applicator.reset(
new KisProcessingApplicator(m_image, m_node,
......
......@@ -157,7 +157,7 @@ void KisToolFill::endPrimaryAction(KoPointerEvent *event)
KisProcessingApplicator applicator(currentImage(), currentNode(),
KisProcessingApplicator::SUPPORTS_WRAPAROUND_MODE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
kundo2_i18n("Flood Fill"));
KisResourcesSnapshotSP resources =
......
......@@ -160,7 +160,7 @@ void KisToolGradient::endPrimaryAction(KoPointerEvent *event)
KUndo2MagicString actionName = kundo2_i18n("Gradient");
KisProcessingApplicator applicator(image, resources->currentNode(),
KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
actionName);
applicator.applyCommand(
......
......@@ -91,7 +91,7 @@ void KisToolSelectContiguous::beginPrimaryAction(KoPointerEvent *event)
KisProcessingApplicator applicator(currentImage(), currentNode(),
KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
kundo2_i18n("Select Contiguous Area"));
QPoint pos = convertToImagePixelCoordFloored(event);
......
......@@ -124,7 +124,7 @@ void KisToolSelectSimilar::beginPrimaryAction(KoPointerEvent *event)
KisProcessingApplicator applicator(currentImage(), currentNode(),
KisProcessingApplicator::NONE,
KisImageSignalVector() << ModifiedSignal,
KisImageSignalVector(),
kundo2_i18n("Select Contiguous Area"));
......
......@@ -168,7 +168,7 @@ void KisToolSmartPatch::endPrimaryAction(KoPointerEvent *event)
KisResourcesSnapshotSP resources =
new KisResourcesSnapshot(image(), currentNode(), this->canvas()->resourceManager());
KisProcessingApplicator applicator( image(), currentNode(), KisProcessingApplicator::NONE, KisImageSignalVector() << ModifiedSignal,
KisProcessingApplicator applicator( image(), currentNode(), KisProcessingApplicator::NONE, KisImageSignalVector(),
kundo2_i18n("Smart Patch"));
//actual inpaint operation. filling in areas masked by user
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment