summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Stefan Fuchs <sfuchs@gmx.de>2017-03-11 07:43:30 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-03-11 07:27:18 -0800
commitb8e044dee350076984e998d4d797ec4e7a191f41 (patch)
tree6dccb8a002527696aa9d76930171a6f930984f82
parentab887e44386e89e14a8f9947ca28392059134473 (diff)
downloadsubsurface-b8e044dee350076984e998d4d797ec4e7a191f41.tar.gz
Don't erroneously mark the cylinder pressure red and set font italic
In the cylinder table today the cylinder start and end pressure fields are marked red and the end pressure font is set to italic if cyl->end is 0. But sometimes with planned dives there is no cyl->end but only cyl->sample_end. This is taken into account now. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
-rw-r--r--qt-models/cylindermodel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index d7e026591..843792ae7 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -143,7 +143,7 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
// seem implausible
case START:
case END:
- if ((cyl->start.mbar && !cyl->end.mbar) ||
+ if ((cyl->start.mbar && !cyl->end.mbar && !cyl->sample_end.mbar) ||
(cyl->end.mbar && cyl->start.mbar <= cyl->end.mbar))
ret = REDORANGE1_HIGH_TRANS;
break;
@@ -157,7 +157,7 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
font.setItalic(!cyl->start.mbar);
break;
case END:
- font.setItalic(!cyl->end.mbar);
+ font.setItalic(!cyl->end.mbar && !cyl->sample_end.mbar);
break;
}
ret = font;