mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
e5c70de1ee
commit
80bdbc348d
1 changed files with 12 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue