From e34bf957188e0f79ef79c56c72780f5881c2c24e Mon Sep 17 00:00:00 2001 From: Tim Wootton Date: Tue, 19 Jul 2016 06:55:21 +0100 Subject: Only add non-blank weights to the weight list Signed-off-by: Tim Wootton Signed-off-by: Dirk Hohndel --- core/subsurface-qt/DiveObjectHelper.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core/subsurface-qt') diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 1c7621e10..aca6ae62f 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -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; } -- cgit v1.2.3-70-g09d2