From 2516ae7e5f2a8912a394181fe451337a3a22c9ee Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sat, 4 Feb 2017 14:12:43 +0100 Subject: Let cylinderid = -1 mean same gas as before It's not too clever to give 0 a special meaning (as here: use same gas as for previous leg) when 0 is a legitimate value. This should solve Willem's gas disappearance problem when reediting a dive in the planner. Signed-off-by: Robert C. Helling --- qt-models/diveplannermodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-models/diveplannermodel.cpp') diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 5a06313f4..38fbbb1b8 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -588,11 +588,12 @@ int DivePlannerPointsModel::lastEnteredPoint() return -1; } +// cylinderid_in == -1 means same gas as before. int DivePlannerPointsModel::addStop(int milimeters, int seconds, int cylinderid_in, int ccpoint, bool entered) { int cylinderid = 0; bool usePrevious = false; - if (cylinderid_in) + if (cylinderid_in >= 0) cylinderid = cylinderid_in; else usePrevious = true; -- cgit v1.2.3-70-g09d2