Mobile: Generate DiveObjectHelpers on the fly

Instead of keeping track of a list of DiveObjectHelpers, generate
them on-the-fly in DiveListModel. Thus, there is less danger of
model and core getting out of sync. On the flip-side, now the
DiveListModel and the DiveListSortModel might get out of sync.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-08-13 08:19:04 +02:00 committed by bstoeger
parent be763452ad
commit f8c5c8bedf
4 changed files with 31 additions and 32 deletions

View file

@ -67,6 +67,16 @@ DiveObjectHelper::DiveObjectHelper(struct dive *d) :
{
}
DiveObjectHelper::operator bool() const
{
return !!m_dive;
}
bool DiveObjectHelper::operator!() const
{
return !m_dive;
}
int DiveObjectHelper::number() const
{
return m_dive->number;