summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt
diff options
context:
space:
mode:
authorGravatar Tim Wootton <tim@tee-jay.org.uk>2016-07-19 06:55:21 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-23 10:52:55 +0900
commite34bf957188e0f79ef79c56c72780f5881c2c24e (patch)
tree0e79ae993f2ad64ecd05d6c01ddd846933e2bb33 /core/subsurface-qt
parentb66b38721597b8f52b2db35fc373abdfd363a529 (diff)
downloadsubsurface-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.cpp8
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;
}