From 37c159aae10589ffd15b24a88a52da0a308e09a4 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 1 Apr 2019 23:00:22 +0200 Subject: Map: reload map when editing dive site of a dive Editing the dive site of a dive may make a dive site appear (first dive of that site) or disappear (the last dive of that site was removed). Therefore, we have to reload the dive site markers on editing the site of a dive. This should be made smarter by only reloading the markers if the dive site status actually changed. Signed-off-by: Berthold Stoeger --- desktop-widgets/tab-widgets/maintab.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 099487aea..1be907ccc 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -366,6 +366,10 @@ void MainTab::divesChanged(dive_trip *trip, const QVector &dives, DiveFi break; case DiveField::DIVESITE: updateDiveSite(current_dive); + // Since we only show dive sites with a dive, a new dive site may have appeared or an old one disappeared. + // Therefore reload the map widget. + // TODO: Call this only if a site *actually* went from usage count 0 to 1 or 1 to 0. + MapWidget::instance()->repopulateLabels(); emit diveSiteChanged(); break; case DiveField::TAGS: -- cgit v1.2.3-70-g09d2