From f1d73606e5addc0f4d5d9b5a26dfd4527ce14bdc Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 11 Mar 2016 13:17:57 -0800 Subject: QML UI: don't allow negative gas consumption If end pressure is higher than start pressure, simply use the same start and end pressure. Fixes #1024 Signed-off-by: Dirk Hohndel --- qt-mobile/qmlmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index ec18f8cb0..ed53f7f07 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -609,6 +609,8 @@ parsed: diveChanged = true; d->cylinder[0].start.mbar = parsePressureToMbar(startpressure); d->cylinder[0].end.mbar = parsePressureToMbar(endpressure); + if (d->cylinder[0].end.mbar > d->cylinder[0].start.mbar) + d->cylinder[0].end.mbar = d->cylinder[0].start.mbar; } // gasmix for first cylinder if (get_gas_string(d->cylinder[0].gasmix) != gasmix) { -- cgit v1.2.3-70-g09d2