diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-11-16 18:46:07 +0000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-16 18:46:07 +0000 |
commit | 80bdbc348ddbda176aa03002a0923e6a5b5f8475 (patch) | |
tree | 9685622849b01416962db75baae8aa7cd8cc4a6a /qt-ui | |
parent | e5c70de1ee7fef992244935cb8c9643cc76653ec (diff) | |
download | subsurface-80bdbc348ddbda176aa03002a0923e6a5b5f8475.tar.gz |
Divelist trip text includes the number of dives shown with current filter
But only if not all dives in the trip are shown.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/models.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index f73b1dc94..7cf305d83 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -1068,10 +1068,20 @@ QVariant TripItem::data(int column, int role) const if (role == Qt::DisplayRole) { switch (column) { case DiveTripModel::NR: + QString shownText; + struct dive *d = trip->dives; + int countShown = 0; + while (d) { + if (!d->hidden_by_filter) + countShown++; + d = d->next; + } + if (countShown < trip->nrdives) + shownText = tr(" (%1 shown)").arg(countShown); if (trip->location && *trip->location) - ret = QString(trip->location) + ", " + get_trip_date_string(trip->when, trip->nrdives); + ret = QString(trip->location) + ", " + get_trip_date_string(trip->when, trip->nrdives) + shownText; else - ret = get_trip_date_string(trip->when, trip->nrdives); + ret = get_trip_date_string(trip->when, trip->nrdives) + shownText; break; } } |