summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2014-08-02 23:21:19 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-02 15:12:42 -0700
commit89622b0b5151c4841398efce6433a72a62a109f2 (patch)
tree1ee0d0eb9cb10c0a376018a82e590e41a93440bf /qt-ui
parenta7eb316b1f8270500f608293cc40c29fde3056dc (diff)
downloadsubsurface-89622b0b5151c4841398efce6433a72a62a109f2.tar.gz
Enforce end pressures to be not above starting pressures.
We don't blow into our cylinders under water. Negative pressures should be allowed as they might arise from dive planning without taking care of gas consumption. fixes #644 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/models.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 9d43da624..8963c1287 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -235,13 +235,13 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
}
break;
case START:
- if (CHANGED()) {
+ if (CHANGED() && (!cyl->end.mbar || string_to_pressure(vString.toUtf8().data()).mbar >= cyl->end.mbar)) {
cyl->start = string_to_pressure(vString.toUtf8().data());
changed = true;
}
break;
case END:
- if (CHANGED()) {
+ if (CHANGED() && (!cyl->start.mbar || string_to_pressure(vString.toUtf8().data()).mbar <= cyl->start.mbar)) {
cyl->end = string_to_pressure(vString.toUtf8().data());
changed = true;
}