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>
This commit is contained in:
Dirk Hohndel 2016-02-05 22:53:12 -08:00
parent 535a6b9b25
commit ad7fb80d0a
2 changed files with 7 additions and 0 deletions

View file

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