summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 47306bad9..416119b3b 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -634,21 +634,6 @@ void MainWindow::on_actionCloudOnline_triggered()
updateCloudOnlineStatus();
}
-void MainWindow::cleanUpEmpty()
-{
- current_dive = nullptr;
- mainTab->clearTabs();
- mainTab->updateDiveInfo();
- graphics->setEmptyState();
- diveList->reload();
- diveList->setSortOrder(DiveTripModelBase::NR, Qt::DescendingOrder);
- MapWidget::instance()->reload();
- LocationInformationModel::instance()->update();
- if (!existing_filename)
- setTitle();
- disableShortcuts();
-}
-
bool MainWindow::okToClose(QString message)
{
if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING ||
@@ -670,12 +655,21 @@ void MainWindow::setFileClean()
void MainWindow::closeCurrentFile()
{
- graphics->setEmptyState();
/* free the dives and trips */
clear_git_id();
clear_dive_file_data();
+ current_dive = nullptr;
setCurrentFile(nullptr);
- cleanUpEmpty();
+ graphics->setEmptyState();
+ mainTab->clearTabs();
+ mainTab->updateDiveInfo();
+ diveList->reload();
+ diveList->setSortOrder(DiveTripModelBase::NR, Qt::DescendingOrder);
+ MapWidget::instance()->reload();
+ LocationInformationModel::instance()->update();
+ if (!existing_filename)
+ setTitle();
+ disableShortcuts();
setFileClean();
clear_events();