From 3b9c28bce7e8475b6bb59d7dbc9c0f4f7290734d Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 15 Nov 2013 12:41:00 -0800 Subject: 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 --- qt-ui/diveplanner.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 7d3e19fc0..09bef08e8 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -449,6 +449,8 @@ void DivePlannerPointsModel::loadFromDive(dive* d) int lasttime = 0; Q_FOREACH(const sample &s, backupSamples){ int o2 = 0, he = 0; + if (s.time.seconds == 0) + continue; get_gas_from_events(&backupDive->dc, lasttime, &o2, &he); plannerModel->addStop(s.depth.mm, s.time.seconds, o2, he, 0); lasttime = s.time.seconds; -- cgit v1.2.3-70-g09d2