From 4fa3f89378b7079bc662d2b024b200512904ce0a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 30 Oct 2014 14:08:10 -0700 Subject: Fix adding gas change to a dive Yikes this was stupid. We mixed changing the displayed_dive and the current_dive. So we'd pass in the displayed_dive and a pointer to the dive_computer structure of the current dc in the current dive. Oops. This makes much more sense. And: Fixes #738 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qt-ui/profile/profilewidget2.cpp') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 22e5c46df..17cb19f65 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1243,7 +1243,9 @@ void ProfileWidget2::changeGas() qDebug() << "failed to parse tank number"; tank = get_gasidx(&displayed_dive, &gasmix); } - add_gas_switch_event(&displayed_dive, current_dc, seconds, tank); + // add this both to the displayed dive and the current dive + add_gas_switch_event(current_dive, current_dc, seconds, tank); + add_gas_switch_event(&displayed_dive, get_dive_dc(&displayed_dive, dc_number), seconds, tank); // this means we potentially have a new tank that is being used and needs to be shown fixup_dive(&displayed_dive); -- cgit v1.2.3-70-g09d2