summaryrefslogtreecommitdiffstats
path: root/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-05 22:53:12 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-05 22:53:12 -0800
commitad7fb80d0ac874e55ce91e5845f85aa12906941f (patch)
tree40941ae46e5efeac23afeee2a03131b7f1a20423 /subsurface-core/subsurface-qt/DiveObjectHelper.cpp
parent535a6b9b2529925bba8b665ce7523a74647d5f53 (diff)
downloadsubsurface-ad7fb80d0ac874e55ce91e5845f85aa12906941f.tar.gz
DiveObjectHelper: check if dive has only one weightsystem
The mobile app should only allow editing the weight entry if there is no second weight defined. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/subsurface-qt/DiveObjectHelper.cpp')
-rw-r--r--subsurface-core/subsurface-qt/DiveObjectHelper.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
index 745379494..2f058f47f 100644
--- a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
+++ b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
@@ -187,6 +187,11 @@ QStringList DiveObjectHelper::weights() const
return weights;
}
+bool DiveObjectHelper::singleWeight() const
+{
+ return weightsystem_none(&m_dive->weightsystem[1]);
+}
+
QString DiveObjectHelper::weight(int idx) const
{
if ( (idx < 0) || idx > MAX_WEIGHTSYSTEMS )