mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: when adding new waypoint at the end, use previous gas
In commit b0da8c2707
("When adding a waypoint, use the gasmix of the
_next_ waypoint.") we default to air when adding a waypoint at the end of
the plan by double-clicking. That seems silly since we could instead
continue using the last gas.
I wasn't able to reproduce the "gas list disappears" problem in bug #623,
but I did get a silly air segment added which was equally wrong. Maybe I'm
lucky and this fixes the problem that Henrik sees as well...
See #623
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4eec911d3a
commit
133e104393
1 changed files with 2 additions and 0 deletions
|
@ -829,6 +829,8 @@ int DivePlannerPointsModel::addStop(int milimeters, int seconds, gasmix *gas_in,
|
|||
if (usePrevious) {
|
||||
if (row < divepoints.count()) {
|
||||
gas = divepoints.at(row).gasmix;
|
||||
} else if (row > 0) {
|
||||
gas = divepoints.at(row - 1).gasmix;
|
||||
} else {
|
||||
if (!addGas(air))
|
||||
qDebug("addGas failed"); // FIXME add error propagation
|
||||
|
|
Loading…
Add table
Reference in a new issue