mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
88015f402b
commit
22c83af6ad
1 changed files with 9 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue