From 0b5a1719a17eaaaa4d08ca34b17d4b4600083715 Mon Sep 17 00:00:00 2001 From: Tim Wootton Date: Tue, 19 Jul 2016 00:06:10 +0100 Subject: Only add non-blank cylinder strings to the cylinder list Signed-off-by: Tim Wootton Signed-off-by: Dirk Hohndel --- core/subsurface-qt/DiveObjectHelper.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index aca6ae62f..69bd7999f 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -259,8 +259,12 @@ QString DiveObjectHelper::cylinderList() const QStringList DiveObjectHelper::cylinders() const { QStringList cylinders; - for (int i = 0; i < MAX_CYLINDERS; i++) - cylinders << getFormattedCylinder(m_dive, i); + for (int i = 0; i < MAX_CYLINDERS; i++) { + QString cyl = getFormattedCylinder(m_dive, i); + if (cyl == EMPTY_DIVE_STRING) + continue; + cylinders << cyl; + } return cylinders; } -- cgit v1.2.3-70-g09d2