summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-21 23:26:50 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-25 13:59:04 -0700
commitc263487e7ce7c7b22e516650eb857c646728c34a (patch)
tree0f78e7da3c9b5e6cabcd2e2ba0b81f952a725d6d /desktop-widgets
parentd403532a864f5cfc9f2c5e8a62edfcdaacdd105a (diff)
downloadsubsurface-c263487e7ce7c7b22e516650eb857c646728c34a.tar.gz
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>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp14
-rw-r--r--desktop-widgets/mainwindow.h1
2 files changed, 4 insertions, 11 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 29cc2c1e4..c2c3f63dd 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -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;
}
diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h
index 4785760a5..e0d53b20d 100644
--- a/desktop-widgets/mainwindow.h
+++ b/desktop-widgets/mainwindow.h
@@ -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);