diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-03-10 22:03:00 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-03-10 22:03:00 -0800 |
commit | ba89d9bbb1e22be96b879021ee2884c05772033c (patch) | |
tree | 6cc4b797abfa63697043aa7a76a336f1c8b4b1a4 /qt-mobile | |
parent | 969ca3d9ea4e2a9ccc959750957c3fc57f7bfb2b (diff) | |
download | subsurface-ba89d9bbb1e22be96b879021ee2884c05772033c.tar.gz |
QML UI: correctly validate the gasmix entered
We parsed it correctly, but then compared the permille values against
percent thresholds. What a stupid bug.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index a4759be43..5b734e3a8 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -612,9 +612,9 @@ parsed: int o2 = parseGasMixO2(gasmix); int he = parseGasMixHE(gasmix); // the QML code SHOULD only accept valid gas mixes, but just to make sure - if (o2 >= 0 && o2 <= 100 && - he >= 0 && he <= 100 && - o2 + he <= 100) { + if (o2 >= 0 && o2 <= 1000 && + he >= 0 && he <= 1000 && + o2 + he <= 1000) { diveChanged = true; d->cylinder[0].gasmix.o2.permille = o2; d->cylinder[0].gasmix.he.permille = he; |