Don't add spurious 5m/15ft node at 10 minutes when canceling edit

When cancelling the edit of a manually added dive, we should send the
sample with timestamp 0 to addStop - that's a magic value and causes us to
add a node at 5m/15ft and 10 minutes instead. Since the dive always starts
at the surface, calling addStop is redundant, anyway, so let's just not do
that.

See #270

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-18 10:46:01 -08:00
parent 7d0cc6b337
commit 3801b765ff

View file

@ -1416,9 +1416,11 @@ void DivePlannerPointsModel::undoEdition()
{
clear();
Q_FOREACH(const sample &s, backupSamples){
int o2, he;
get_gas_from_events(&current_dive->dc, s.time.seconds, &o2, &he);
plannerModel->addStop(s.depth.mm, s.time.seconds, o2, he, 0);
if (s.time.seconds > 0) {
int o2, he;
get_gas_from_events(&current_dive->dc, s.time.seconds, &o2, &he);
plannerModel->addStop(s.depth.mm, s.time.seconds, o2, he, 0);
}
}
}