Last added dive planner point for correct lenght not always added

Don't add the last stop with addstop for correcting the lenght
of the dive if planner generated points can be removed when replanning.
Otherwise this will not be deleted when replanning a dive.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2017-04-16 11:24:41 +02:00 committed by Dirk Hohndel
parent 74a5511b39
commit a19f9c22ce

View file

@ -119,7 +119,7 @@ void DivePlannerPointsModel::loadFromDive(dive *d)
}
}
// make sure we get the last point right so the duration is correct
addStop(0, d->dc.duration.seconds,cylinderid, 0, true);
if (!hasMarkedSamples) addStop(0, d->dc.duration.seconds,cylinderid, 0, true);
recalc = oldRec;
emitDataChanged();
}