summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/DiveObjectHelper.cpp
diff options
context:
space:
mode:
authorGravatar Tim Wootton <tim@tee-jay.org.uk>2016-07-19 00:06:10 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-23 10:55:17 +0900
commit0b5a1719a17eaaaa4d08ca34b17d4b4600083715 (patch)
tree59ef8b1ceeb10153b481ceeecfcb648a409a68bb /core/subsurface-qt/DiveObjectHelper.cpp
parentb0ad1aa969c0906109698d51acea868440994b75 (diff)
downloadsubsurface-0b5a1719a17eaaaa4d08ca34b17d4b4600083715.tar.gz
Only add non-blank cylinder strings to the cylinder list
Signed-off-by: Tim Wootton <tim@tee-jay.org.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurface-qt/DiveObjectHelper.cpp')
-rw-r--r--core/subsurface-qt/DiveObjectHelper.cpp8
1 files 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;
}