Only add non-blank weights to the weight 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 06:55:21 +01:00 committed by Dirk Hohndel
parent b66b387215
commit e34bf95718

View file

@ -218,8 +218,12 @@ QString DiveObjectHelper::weightList() const
QStringList DiveObjectHelper::weights() const
{
QStringList weights;
for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++)
weights << getFormattedWeight(m_dive, i);
for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++) {
QString w = getFormattedWeight(m_dive, i);
if (w == EMPTY_DIVE_STRING)
continue;
weights << w;
}
return weights;
}