From cbe6d89767e95a6f6e4db2dbaaf85371877c1c12 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 4 Dec 2021 16:21:33 +0100 Subject: [PATCH] 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 --- CHANGELOG.md | 1 + commands/command_edit.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 634342ab3..5a0d33a7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index c31be4e47..cf2d0e5d3 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -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