From 3801b765fff847adff1899c7d54484b0bb100c87 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 18 Nov 2013 10:46:01 -0800 Subject: Don't add spurious 5m/15ft node at 10 minutes when canceling edit When cancelling the edit of a manually added dive, we should send the sample with timestamp 0 to addStop - that's a magic value and causes us to add a node at 5m/15ft and 10 minutes instead. Since the dive always starts at the surface, calling addStop is redundant, anyway, so let's just not do that. See #270 Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 643f35a2d..39fe0548f 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1416,9 +1416,11 @@ void DivePlannerPointsModel::undoEdition() { clear(); Q_FOREACH(const sample &s, backupSamples){ - int o2, he; - get_gas_from_events(¤t_dive->dc, s.time.seconds, &o2, &he); - plannerModel->addStop(s.depth.mm, s.time.seconds, o2, he, 0); + if (s.time.seconds > 0) { + int o2, he; + get_gas_from_events(¤t_dive->dc, s.time.seconds, &o2, &he); + plannerModel->addStop(s.depth.mm, s.time.seconds, o2, he, 0); + } } } -- cgit v1.2.3-70-g09d2