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

@ -62,9 +62,8 @@ public:
QHash<int, QByteArray> roleNames() const;
QString startAddDive();
void resetInternalData();
Q_INVOKABLE DiveObjectHelper* at(int i);
Q_INVOKABLE DiveObjectHelper at(int i);
private:
QList<DiveObjectHelper*> m_dives;
static DiveListModel *m_instance;
};