diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-11-15 12:41:00 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-15 12:42:21 -0800 |
commit | 3b9c28bce7e8475b6bb59d7dbc9c0f4f7290734d (patch) | |
tree | 3bf905ccd193c54d4c58abcb33a37b3a242ef3d5 | |
parent | c4a47a7d60b53c9b2e2ffb874afaf733d43123aa (diff) | |
download | subsurface-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>
-rw-r--r-- | qt-ui/diveplanner.cpp | 2 |
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; |