summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-15 12:41:00 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-15 12:42:21 -0800
commit3b9c28bce7e8475b6bb59d7dbc9c0f4f7290734d (patch)
tree3bf905ccd193c54d4c58abcb33a37b3a242ef3d5 /qt-ui/diveplanner.cpp
parentc4a47a7d60b53c9b2e2ffb874afaf733d43123aa (diff)
downloadsubsurface-3b9c28bce7e8475b6bb59d7dbc9c0f4f7290734d.tar.gz
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>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp2
1 files changed, 2 insertions, 0 deletions
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;