From b8e044dee350076984e998d4d797ec4e7a191f41 Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Sat, 11 Mar 2017 07:43:30 +0100 Subject: 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 --- qt-models/cylindermodel.cpp | 4 ++-- 1 file 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; -- cgit v1.2.3-70-g09d2