Mobile: move tripNrDive from DiveObjectHelper to DiveListModel

We don't want to generate a DiveObjectHelper numerous times for
every item in the dive list. Therefore, return this datum directly
from the model.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-08-15 00:03:15 +02:00 committed by bstoeger
parent 1b9581369a
commit 54720e6cff
5 changed files with 6 additions and 11 deletions

View file

@ -315,12 +315,6 @@ QVector<CylinderObjectHelper> DiveObjectHelper::cylinderObjects() const
return res;
}
int DiveObjectHelper::tripNrDives() const
{
struct dive_trip *dt = m_dive->divetrip;
return dt ? dt->dives.nr : 0;
}
int DiveObjectHelper::maxcns() const
{
return m_dive->maxcns;