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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-08-10 17:53:11 +02:00 committed by Dirk Hohndel
parent 624ab3bf9e
commit 75be9e727d

View file

@ -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