Commit af6febcd authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix activation of the autosave timer after modify+save+modify cycle

There were two problems:

1) modifiedAfterAutosave should be reset false every time
   we mark the image as clean. Otherwise it may keep the
   old value

2) modifiedAfterAutosave value should be used **only** for
   the autosave slot entry. For restarting the time we should
   ask the timer itself

BUG:393266
parent 6aa6c744
......@@ -1247,12 +1247,6 @@ bool KisDocument::loadNativeFormat(const QString & file_)
return openUrl(QUrl::fromLocalFile(file_));
}
void KisDocument::setModified()
{
d->modified = true;
}
void KisDocument::setModified(bool mod)
{
if (mod) {
......@@ -1270,12 +1264,12 @@ void KisDocument::setModified(bool mod)
//dbgUI<<" url:" << url.path();
//dbgUI<<" mod="<<mod<<" MParts mod="<<KisParts::ReadWritePart::isModified()<<" isModified="<<isModified();
if (mod && !d->modifiedAfterAutosave) {
if (mod && !d->autoSaveTimer->isActive()) {
// First change since last autosave -> start the autosave timer
setNormalAutoSaveInterval();
}
d->modifiedAfterAutosave |= mod;
d->modifiedWhileSaving |= mod;
d->modifiedAfterAutosave = mod;
d->modifiedWhileSaving = mod;
if (mod == isModified())
return;
......
......@@ -503,9 +503,6 @@ private:
*/
bool openFile();
/** @internal */
void setModified();
public:
bool isAutosaving() const override;
......
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