Don't create stop at time zero when re-editing manually added dive

To our addStop method time = 0 & depth = 0 are a magic flag. And since we
always start at the surface, that is assumed, anyway. So let's just not
add a stop for that when re-creating a plan from a dive.

Fixes #254

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-15 12:41:00 -08:00
parent c4a47a7d60
commit 3b9c28bce7

View file

@ -449,6 +449,8 @@ void DivePlannerPointsModel::loadFromDive(dive* d)
int lasttime = 0; int lasttime = 0;
Q_FOREACH(const sample &s, backupSamples){ Q_FOREACH(const sample &s, backupSamples){
int o2 = 0, he = 0; int o2 = 0, he = 0;
if (s.time.seconds == 0)
continue;
get_gas_from_events(&backupDive->dc, lasttime, &o2, &he); get_gas_from_events(&backupDive->dc, lasttime, &o2, &he);
plannerModel->addStop(s.depth.mm, s.time.seconds, o2, he, 0); plannerModel->addStop(s.depth.mm, s.time.seconds, o2, he, 0);
lasttime = s.time.seconds; lasttime = s.time.seconds;