summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp5
-rw-r--r--desktop-widgets/mapwidget.cpp1
2 files changed, 2 insertions, 4 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index dfe00bfe1..f4eadab16 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -408,15 +408,12 @@ MainWindow *MainWindow::instance()
void MainWindow::refreshDisplay(bool doRecreateDiveList)
{
mainTab->reload();
- TankInfoModel::instance()->update();
if (doRecreateDiveList)
diveList->reload();
- MapWidget::instance()->reload();
setApplicationState(ApplicationState::Default);
diveList->setEnabled(true);
diveList->setFocus();
- WSInfoModel::instance()->update();
ui.actionAutoGroup->setChecked(autogroup);
}
@@ -647,7 +644,7 @@ void MainWindow::closeCurrentFile()
{
/* free the dives and trips */
clear_git_id();
- MultiFilterSortModel::instance()->clear(); // this clears all the core data structures
+ clear_dive_file_data(); // this clears all the core data structures and resets the models
setCurrentFile(nullptr);
diveList->setSortOrder(DiveTripModelBase::NR, Qt::DescendingOrder);
MapWidget::instance()->reload();
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp
index 0e04ae282..2d23f0916 100644
--- a/desktop-widgets/mapwidget.cpp
+++ b/desktop-widgets/mapwidget.cpp
@@ -28,6 +28,7 @@ MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
setResizeMode(QQuickWidget::SizeRootObjectToView);
connect(this, &QQuickWidget::statusChanged, this, &MapWidget::doneLoading);
connect(&diveListNotifier, &DiveListNotifier::divesChanged, this, &MapWidget::divesChanged);
+ connect(&diveListNotifier, &DiveListNotifier::dataReset, this, &MapWidget::reload);
setSource(urlMapWidget);
}