Mobile: pass section directly to tripTitle() and tripShortDate()

Instead of converting the section-heading string to a trip-pointer
in QML and pass that to the tripTitle() and tripShortDate()
functions, pass the string and convert in C++ code.

Hopefully, this makes the code more robust.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-09-14 19:58:30 +02:00 committed by Dirk Hohndel
parent ce751bd696
commit 9322c54b6a
3 changed files with 12 additions and 15 deletions

View file

@ -14,9 +14,8 @@ public:
DiveListSortModel(QObject *parent = 0);
void setSourceModel(QAbstractItemModel *sourceModel);
Q_INVOKABLE void reload();
Q_INVOKABLE QVariant tripIdToObject(const QString &s);
Q_INVOKABLE QString tripTitle(const QVariant &trip);
Q_INVOKABLE QString tripShortDate(const QVariant &trip);
Q_INVOKABLE QString tripTitle(const QString &trip);
Q_INVOKABLE QString tripShortDate(const QString &trip);
public slots:
int getIdxForId(int id);
void setFilter(QString f);