diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-10-30 14:08:10 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-10-30 14:08:10 -0700 |
commit | 4fa3f89378b7079bc662d2b024b200512904ce0a (patch) | |
tree | 2456640c64499a038faae4ac3092573ceb14cab0 /qt-ui/profile/profilewidget2.cpp | |
parent | 4a42fdaa71ffc5d95756cce6d36fac3061636c34 (diff) | |
download | subsurface-4fa3f89378b7079bc662d2b024b200512904ce0a.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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); |