Dive site: use displayed_dive in MainTab::refreshDisplayedDiveSite

MainTab::refreshDisplayedDiveSite() was used after dive-site edit
to update the information of the location entry box. This should
always display the dive-site of the currently shown/edited dive,
therefore it makes no sense to use the displayed_dive_site here.
Simply use the dive site of displayed_dive.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-10-12 09:25:00 +02:00 committed by Dirk Hohndel
parent 73b8bd12e5
commit ebd6d4fc45

View file

@ -656,9 +656,10 @@ MainTab::EditMode MainTab::getEditMode() const
void MainTab::refreshDisplayedDiveSite()
{
if (displayed_dive_site.uuid) {
copy_dive_site(get_dive_site_by_uuid(displayed_dive_site.uuid), &displayed_dive_site);
ui.location->setCurrentDiveSiteUuid(displayed_dive_site.uuid);
struct dive_site *ds = get_dive_site_for_dive(&displayed_dive);
if (ds) {
copy_dive_site(ds, &displayed_dive_site);
ui.location->setCurrentDiveSiteUuid(ds->uuid);
}
}