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>
This commit is contained in:
Tim Wootton 2016-07-19 00:06:10 +01:00 committed by Dirk Hohndel
parent b0ad1aa969
commit 0b5a1719a1

View file

@ -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;
}