From 98322a976cac3884d6e023d4b29cdd4c3d4f43bc Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 13 Nov 2013 22:39:05 +0900 Subject: 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 --- qt-ui/diveplanner.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } } -- cgit v1.2.3-70-g09d2