profile: fix editing depth / duration

The undo commands for depth and duration editing cleared
the samples of the dive computer. They relied on the profile
automatically creating a fake profile. However, at some point
that code got removed. Therefore, do it explicitly in the undo
command.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-12-04 16:21:33 +01:00 committed by Dirk Hohndel
parent 1e527fb9f0
commit cbe6d89767
2 changed files with 3 additions and 0 deletions

View file

@ -1,3 +1,4 @@
Profile: Fix editing of time / duration (profile of edited dive was not shown)
Divelist: Don't attempt to compute SAC for CCR dives
---
* Always add new entries at the very top of this file above other existing entries and this note.

View file

@ -306,6 +306,7 @@ void EditDuration::set(struct dive *d, int value) const
d->duration = d->dc.duration;
d->dc.meandepth.mm = 0;
d->dc.samples = 0;
fake_dc(&d->dc);
}
int EditDuration::data(struct dive *d) const
@ -325,6 +326,7 @@ void EditDepth::set(struct dive *d, int value) const
d->maxdepth = d->dc.maxdepth;
d->dc.meandepth.mm = 0;
d->dc.samples = 0;
fake_dc(&d->dc);
}
int EditDepth::data(struct dive *d) const