cleanup: remove MainWindow::setFileClean()

This function was used to unify both methods of tracking unsaved
changes. Since desktop now only uses the undo system, it can
be replaced by a single call to "Command::setClean()".

Arguably, the UI is the wrong place to do this and the appropriate
calls should be done by the core. However, let's play it safe
for now and avoid any breaking change.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-10-21 23:26:50 +02:00 committed by Dirk Hohndel
parent d403532a86
commit c263487e7c
2 changed files with 4 additions and 11 deletions

View file

@ -567,7 +567,7 @@ void MainWindow::on_actionCloudstoragesave_triggered()
return;
setCurrentFile(qPrintable(filename));
setFileClean();
Command::setClean();
}
void MainWindow::on_actionCloudOnline_triggered()
@ -623,12 +623,6 @@ bool MainWindow::okToClose(QString message)
return true;
}
void MainWindow::setFileClean()
{
mark_divelist_changed(false);
Command::setClean();
}
void MainWindow::closeCurrentFile()
{
/* free the dives and trips */
@ -640,7 +634,7 @@ void MainWindow::closeCurrentFile()
if (!existing_filename)
setTitle();
disableShortcuts();
setFileClean();
Command::setClean();
}
void MainWindow::updateCloudOnlineStatus()
@ -1444,7 +1438,7 @@ int MainWindow::file_save_as(void)
return -1;
setCurrentFile(qPrintable(filename));
setFileClean();
Command::setClean();
addRecentFile(filename, true);
return 0;
}
@ -1481,7 +1475,7 @@ int MainWindow::file_save(void)
}
if (is_cloud)
hideProgressBar();
setFileClean();
Command::setClean();
addRecentFile(QString(existing_filename), true);
return 0;
}

View file

@ -198,7 +198,6 @@ private:
void writeSettings();
int file_save();
int file_save_as();
void setFileClean();
void beginChangeState(CurrentState s);
void saveSplitterSizes();
void toggleCollapsible(bool toggle);