Map: reload on selection change directly

When changing the dive selection, we have to reload the map to show
the correctly highlighted flags. Do this directly by hooking into
the DiveListNotifier::divesChanged signal instead of indirectly
via the MainTab.

Moreover, on reload center on the highlighted dive sites.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-05-03 12:10:19 +02:00 committed by Dirk Hohndel
parent 48b8129137
commit d4a91a52fa
5 changed files with 12 additions and 12 deletions

View file

@ -310,11 +310,6 @@ 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:
ui.tagWidget->setText(get_taglist_string(current_dive->tag_list));
@ -593,7 +588,6 @@ void MainTab::updateDiveInfo()
if (verbose && current_dive && current_dive->dive_site)
qDebug() << "Set the current dive site:" << current_dive->dive_site->uuid;
emit diveSiteChanged();
}
void MainTab::reload()