[PATCH] Only add non-blank weights to the weight list
Tim Wootton
tim at tee-jay.org.uk
Mon Jul 18 22:28:23 PDT 2016
Signed-off-by: Tim Wootton <tim at tee-jay.org.uk>
---
core/subsurface-qt/DiveObjectHelper.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp
index e71b076..89d87d5 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++)
+ for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++) {
+ QString w = getFormattedWeight(m_dive, i);
+ if (w == EMPTY_DIVE_STRING)
+ continue;
weights << getFormattedWeight(m_dive, i);
+ }
return weights;
}
--
2.8.1
More information about the subsurface
mailing list