Skip to content
Permalink
Browse files

Reset autosave counter when the document is manually saved

  • Loading branch information...
scribblemaniac committed Apr 12, 2019
1 parent 4f31fe6 commit 1a1238d69b923bd0bc5523860a757282b8775abf
Showing with 9 additions and 1 deletion.
  1. +2 −0 app/src/mainwindow2.cpp
  2. +6 −1 core_lib/src/interface/editor.cpp
  3. +1 −0 core_lib/src/interface/editor.h
@@ -685,6 +685,8 @@ bool MainWindow2::saveObject(QString strSavedFileName)

progress.setValue(progress.maximum());

mEditor->resetAutoSaveCounter();

return true;
}

@@ -480,11 +480,16 @@ void Editor::updateAutoSaveCounter()
mAutosaveCounter++;
if (mAutosaveCounter >= mAutosaveNumber)
{
mAutosaveCounter = 0;
resetAutoSaveCounter();
emit needSave();
}
}

void Editor::resetAutoSaveCounter()
{
mAutosaveCounter = 0;
}

void Editor::cut()
{
copy();
@@ -157,6 +157,7 @@ class Editor : public QObject

void dontAskAutoSave(bool b) { mAutosaveNerverAskAgain = b; }
bool autoSaveNeverAskAgain() { return mAutosaveNerverAskAgain; }
void resetAutoSaveCounter();

protected:
// Need to move to somewhere...

0 comments on commit 1a1238d

Please sign in to comment.
You can’t perform that action at this time.