summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-12 09:25:00 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-13 21:41:41 -0400
commitebd6d4fc45f32527b6d8d45cd670453d925546dc (patch)
treee060fcb809a4c9a8c554ac7c28047ce8e2d3d5c4 /desktop-widgets
parent73b8bd12e54f5040051f929c20b4a5d9c6788a52 (diff)
downloadsubsurface-ebd6d4fc45f32527b6d8d45cd670453d925546dc.tar.gz
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>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 1a024686b..a4b9a55ff 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -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);
}
}