aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.cpp
diff options
context:
space:
mode:
authorGravatar Giorgio Marzano <marzano.giorgio@gmail.com>2015-10-06 21:08:27 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-18 17:37:49 -0700
commit45b1d0d73db6e2116c6de7113feed381dcc5875f (patch)
treebe00cdcb864e2060192e68c46e7d8d37d9e0805a /qt-models/divetripmodel.cpp
parent5d1703cf2c7ebc65ee29e99e40e1c45c4fc1e4ed (diff)
downloadsubsurface-45b1d0d73db6e2116c6de7113feed381dcc5875f.tar.gz
Display day number in trips longer than 1 day
Signed-off-by: Giorgio Marzano <marzano.giorgio@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/divetripmodel.cpp')
-rw-r--r--qt-models/divetripmodel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 819bb5463..78a7a7420 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -43,6 +43,7 @@ static QVariant dive_table_alignment(int column)
QVariant TripItem::data(int column, int role) const
{
QVariant ret;
+ bool oneDayTrip=true;
if (role == DiveTripModel::TRIP_ROLE)
return QVariant::fromValue<void *>(trip);
@@ -59,14 +60,15 @@ QVariant TripItem::data(int column, int role) const
while (d) {
if (!d->hidden_by_filter)
countShown++;
+ oneDayTrip &= is_same_day (trip->when, d->when);
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) + " " + shownText;
+ ret = QString(trip->location) + ", " + get_trip_date_string(trip->when, trip->nrdives, oneDayTrip) + " "+ shownText;
else
- ret = get_trip_date_string(trip->when, trip->nrdives) + shownText;
+ ret = get_trip_date_string(trip->when, trip->nrdives, oneDayTrip) + shownText;
break;
}
}