From 90d321f0ffb3202c8a7c18298dd5871992ecb86a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 17 Oct 2018 06:28:53 -0400 Subject: Mobile/filtering: add count of filtered dives to search bar The count in the trip headers is still that for the complete trip and therefore misleading. Signed-off-by: Dirk Hohndel --- qt-models/divelistmodel.cpp | 5 +++++ qt-models/divelistmodel.h | 1 + 2 files changed, 6 insertions(+) (limited to 'qt-models') diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp index 38c8c86c0..1c4e20b48 100644 --- a/qt-models/divelistmodel.cpp +++ b/qt-models/divelistmodel.cpp @@ -20,6 +20,11 @@ void DiveListSortModel::resetFilter() setFilterRegExp(""); } +int DiveListSortModel::shown() +{ + return rowCount(); +} + int DiveListSortModel::getDiveId(int idx) { DiveListModel *mySourceModel = qobject_cast(sourceModel()); diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h index c34fb931d..b633cc3d5 100644 --- a/qt-models/divelistmodel.h +++ b/qt-models/divelistmodel.h @@ -19,6 +19,7 @@ public slots: int getIdxForId(int id); void setFilter(QString f); void resetFilter(); + int shown(); }; class DiveListModel : public QAbstractListModel -- cgit v1.2.3-70-g09d2