diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-08-14 18:09:17 +0200 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2019-09-14 13:20:59 +0200 |
commit | 0026aa395599489c09be3b7892b96923c670b7cf (patch) | |
tree | df1afd69466092143472ef5411d86cf141945e57 /qt-models/divelistmodel.h | |
parent | 57b77c90b9dad6a114a13fe08b8ae7b986039de8 (diff) | |
download | subsurface-0026aa395599489c09be3b7892b96923c670b7cf.tar.gz |
Mobile: replace clear()/addAllDives() pairs by reload()
The clear()/addAllDives() pair was bogus as the former didn't
clear the model (this is not possible anymore - the model
represents the core dive list) and the latter readded all
dives again.
Replace this by a reload() function.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divelistmodel.h')
-rw-r--r-- | qt-models/divelistmodel.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h index 622cd30f3..e08479a21 100644 --- a/qt-models/divelistmodel.h +++ b/qt-models/divelistmodel.h @@ -13,7 +13,7 @@ class DiveListSortModel : public QSortFilterProxyModel public: DiveListSortModel(QObject *parent = 0); void setSourceModel(QAbstractItemModel *sourceModel); - Q_INVOKABLE void clear(); + 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); @@ -54,7 +54,7 @@ public: void removeDive(int i); void removeDiveById(int id); void updateDive(int i, dive *d); - void clear(); + void reload(); int rowCount(const QModelIndex &parent = QModelIndex()) const; int getDiveIdx(int id) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; |