diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-04-01 23:00:22 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 37c159aae10589ffd15b24a88a52da0a308e09a4 (patch) | |
tree | b8c308beacf6bbdf402fb4796e21350568574e3d /desktop-widgets/tab-widgets | |
parent | 779c4eb5d07b2aaa768ffd8663462ffcab338ccf (diff) | |
download | subsurface-37c159aae10589ffd15b24a88a52da0a308e09a4.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<dive *> &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: |