summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-16 06:40:16 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-16 06:40:16 -0700
commit22c83af6ad9d0fe92568653e9950e21d087ad025 (patch)
tree55f7d7e558cff6dd889692444967fc629172799f /qt-ui
parent88015f402b9d0760b01c7542ce8a9e1ad3ac1ba4 (diff)
downloadsubsurface-22c83af6ad9d0fe92568653e9950e21d087ad025.tar.gz
Dive site handling: make sure the data in displayed_dive is updated
After an edit when the dive is redisplayed we are not copying the data from current dive back over displayed dive (as the reasonable assumption is that we just edited the displayed dive and copied the information into the current dive)- so make sure that after the dive site handling the displayed dive does in fact have the correct dive site information. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 9b4166b35..f86991248 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -1067,6 +1067,15 @@ void MainTab::acceptChanges()
updateDiveSite(get_idx_by_uniq_id(mydive->id));
);
+ // the code above can change the correct uuid for the displayed dive site - and the
+ // code below triggers an update of the display without re-initializing displayed_dive
+ // so let's make sure here that our data is consistent now that we have handled the
+ // dive sites
+ displayed_dive.dive_site_uuid = current_dive->dive_site_uuid;
+ struct dive_site *ds = get_dive_site_by_uuid(displayed_dive.dive_site_uuid);
+ if (ds)
+ copy_dive_site(ds, &displayed_dive_site);
+
// each dive that was selected might have had the temperatures in its active divecomputer changed
// so re-populate the temperatures - easiest way to do this is by calling fixup_dive
for_each_dive (i, d) {