From 20e847f9d8e307524fc33e590ffbb4ed0a248238 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 13 Aug 2019 21:31:53 +0200 Subject: 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 --- qt-models/divelistmodel.h | 1 + 1 file changed, 1 insertion(+) (limited to 'qt-models/divelistmodel.h') 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 roleNames() const; QString startAddDive(); -- cgit v1.2.3-70-g09d2