diff options
author | Tim Wootton <tim@tee-jay.org.uk> | 2016-07-19 06:55:21 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-07-23 10:52:55 +0900 |
commit | e34bf957188e0f79ef79c56c72780f5881c2c24e (patch) | |
tree | 0e79ae993f2ad64ecd05d6c01ddd846933e2bb33 /core/subsurface-qt | |
parent | b66b38721597b8f52b2db35fc373abdfd363a529 (diff) | |
download | subsurface-e34bf957188e0f79ef79c56c72780f5881c2c24e.tar.gz |
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>
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r-- | core/subsurface-qt/DiveObjectHelper.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |