Commit d0602e63 authored by Agata Cacko's avatar Agata Cacko

Revert "Remove KisTool::notifyMdified"

This reverts commit 8ef85fdd.

This commit fixes issue with autosave only saving once per manual save.
Possibly it also fixes the issue with editing time being way lower
than expected.

---

Mentioned commit removed sending signal KisImage->notifyModified()
by KisFreehandTool. Turned out that signal was important for autosave
to work correctly and _possibly_ for counting time spent on the painting.

Theoretically this signal should be also sent by strokes, rendering
sending signal here redundant (hence the previous commit with
"It is not used anymore" message). This requires further investigation
and then recommitting these changes after making sure all logic is
performed as before.

Looks like the course of action with the signal from the Freehand tool was
as follows:

   Freehand Tool sends ModifiedSignal
-> Image Signal Router sends sigImageModified()
-> KisDocument catches it and calls setModified( undoStackNotEmpty )
-> KisDocument does a lot of logic and then sends modified()

Supposedly strokes call KisDocument::setModified(...), at least on master.
I can't confirm it because I didn't check the relevant code yet.
But if that's true, that should be enough - all relevant logic happens
inside this function. On the other hand, practice seems to prove
otherwise...

BUG:411631
parent 68a1eb78
......@@ -345,6 +345,13 @@ QCursor KisTool::cursor() const
return d->cursor;
}
void KisTool::notifyModified() const
{
if (image()) {
image()->setModified();
}
}
KoPattern * KisTool::currentPattern()
{
return d->currentPattern;
......
......@@ -268,6 +268,9 @@ protected:
KisImageWSP image() const;
QCursor cursor() const;
/// Call this to set the document modified
void notifyModified() const;
KisImageWSP currentImage();
KoPattern* currentPattern();
KoAbstractGradient *currentGradient();
......
......@@ -246,6 +246,7 @@ void KisToolFreehand::endPrimaryAction(KoPointerEvent *event)
static_cast<KisCanvas2*>(canvas())->paintingAssistantsDecoration()->endStroke();
}
notifyModified();
KisCanvas2 *canvas2 = dynamic_cast<KisCanvas2 *>(canvas());
if (canvas2) {
canvas2->viewManager()->enableControls();
......
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