diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-02 15:06:54 -0500 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-04-04 22:37:18 -0700 |
commit | e0824ef9f3e2a0cc0fae435b8e3560b309d9708e (patch) | |
tree | 4597890128bc8ebee2dfb4335dc5c9b855e4a68e /desktop-widgets/maintab.cpp | |
parent | 7a444c0210783b926c9f60dd7b436eb086e8f396 (diff) | |
download | subsurface-e0824ef9f3e2a0cc0fae435b8e3560b309d9708e.tar.gz |
Make gas change events always have a cylinder index
In commit df4e26c8757a ("Start sanitizing gaschange event information")
back about a year and a half ago, I started sanitizing the gas switch
event data, allowing gas switches to be associated with a particular
cylinder index rather than just the gas mix that is switched to.
But that initial step only _allowed_ a gas switch event to be associated
with a particular cylinder, the primary model was still to just specify
the mix.
This finally takes the next step, and *always* associates a gas switch
event with a particular cylinder. Instead of then looking up the
cylinder by trying to match gas mixes at runtime, subsurface now looks
it up when loading the dive initially as part of the dive fixup code.
The switch event still has an a separate gas mix associated with it, but
this patch also starts preparing for entirely relying on the gas mix in
the cylinder itself, by starting to pass in not just the event but also
the dive pointer to the routines that look up gas mix details.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/maintab.cpp')
-rw-r--r-- | desktop-widgets/maintab.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop-widgets/maintab.cpp b/desktop-widgets/maintab.cpp index 180814c9c..a3cc151ef 100644 --- a/desktop-widgets/maintab.cpp +++ b/desktop-widgets/maintab.cpp @@ -946,7 +946,7 @@ void MainTab::acceptChanges() get_dive_dc(mydive, dc_number)->divemode = displayed_dc->divemode; } ); - MODIFY_SELECTED_DIVES(update_setpoint_events(get_dive_dc(mydive, dc_number))); + MODIFY_SELECTED_DIVES(update_setpoint_events(mydive, get_dive_dc(mydive, dc_number))); do_replot = true; } if (displayed_dive.watertemp.mkelvin != cd->watertemp.mkelvin) @@ -1237,7 +1237,7 @@ void MainTab::divetype_Changed(int index) return; struct divecomputer *displayed_dc = get_dive_dc(&displayed_dive, dc_number); displayed_dc->divemode = (enum dive_comp_type) index; - update_setpoint_events(displayed_dc); + update_setpoint_events(&displayed_dive, displayed_dc); markChangedWidget(ui.DiveType); MainWindow::instance()->graphics()->recalcCeiling(); } |