1
0
Fork 0
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 ,
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 

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-07-15 03:20:23 -07:00
parent 4eec911d3a
commit 133e104393

View file

@ -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