diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-11-13 22:39:05 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-13 22:39:53 +0900 |
commit | 98322a976cac3884d6e023d4b29cdd4c3d4f43bc (patch) | |
tree | fbe3ff57779d17c35e17f6c825e838630a1051e4 /qt-ui | |
parent | bb041069a35d2ae8dee81d9b0e37bde1b289920d (diff) | |
download | subsurface-98322a976cac3884d6e023d4b29cdd4c3d4f43bc.tar.gz |
Correctly convert an existing dive into a plan
I missed this one spot when converting back to the different semantics for
divedatapoints.
With this change add dive appears to work correctly (fingers crossed).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/diveplanner.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 06d7ae9d1..ab39d42cb 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -444,10 +444,12 @@ void DivePlannerPointsModel::loadFromDive(dive* d) for(int i = 0; i < d->dc.samples-1; i++){ backupSamples.push_back( d->dc.sample[i]); } + int lasttime = 0; Q_FOREACH(const sample &s, backupSamples){ int o2 = 0, he = 0; - get_gas_from_events(&backupDive->dc, s.time.seconds, &o2, &he); + get_gas_from_events(&backupDive->dc, lasttime, &o2, &he); plannerModel->addStop(s.depth.mm, s.time.seconds, o2, he, 0); + lasttime = s.time.seconds; } } |