From 75be9e727d12ebd122f5dc96737248067afc9629 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 10 Aug 2019 17:53:11 +0200 Subject: Mobile: properly recognize single-weightsystem dives When removing the max-weightsystem restriction, the semantics of the DiveObjectHelper::singleWeightSystem() function changed: it now returned false for "no weightsystem". Change it back, to 0 or 1 weightsystems, because the mobile frontend uses this to check whether it can edit dive systems. Signed-off-by: Berthold Stoeger --- core/subsurface-qt/DiveObjectHelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/subsurface-qt') diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 3f740c3e4..3855cef11 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -254,7 +254,7 @@ QStringList DiveObjectHelper::weights() const bool DiveObjectHelper::singleWeight() const { - return m_dive->weightsystems.nr == 1; + return m_dive->weightsystems.nr <= 1; } QString DiveObjectHelper::weight(int idx) const -- cgit v1.2.3-70-g09d2