diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-08-13 21:31:53 +0200 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2019-09-14 13:20:59 +0200 |
commit | 20e847f9d8e307524fc33e590ffbb4ed0a248238 (patch) | |
tree | 8a098faaa4029466bf150bfeb9c801e0e507138b /qt-models/divelistmodel.h | |
parent | 62f1a92068a3322c306f88344bd02836abbade9a (diff) | |
download | subsurface-20e847f9d8e307524fc33e590ffbb4ed0a248238.tar.gz |
Mobile: Map directly from source in DiveListSortModel::getIdxForId()
Instead of looping over all dives and search the dive with the given
id, let the source model determine the index and map that. Thus,
we do only one mapping and don't generate a ton of DiveObjectHelpers.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divelistmodel.h')
-rw-r--r-- | qt-models/divelistmodel.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h index 193d728ea..c355aceaf 100644 --- a/qt-models/divelistmodel.h +++ b/qt-models/divelistmodel.h @@ -58,6 +58,7 @@ public: struct dive *getDive(int i); int rowCount(const QModelIndex &parent = QModelIndex()) const; int getDiveIdx(int id) const; + QModelIndex getDiveQIdx(int id); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QHash<int, QByteArray> roleNames() const; QString startAddDive(); |