aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-09-29 22:45:21 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-03 10:01:13 -0700
commitf4ee8934243d6c924d810b5b2ec5a6c1f3b492f8 (patch)
tree7064f6aac9a344cb5daf54424d8cdf3c8b3a96af /qt-models
parent06c35026d650e2d35f4007012879b37672508e32 (diff)
downloadsubsurface-f4ee8934243d6c924d810b5b2ec5a6c1f3b492f8.tar.gz
cleanup: replace get_trip_date_string() by get_trip_string()
The get_trip_date_string() formatted, as the name implies, the date of a trip. It was passed a number of parameters and had only one caller, which would also add the location if it existed. Therefore, move all that logic into the helper function and name it get_trip_string(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/divetripmodel.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 789fb3b55..539cf98ff 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -119,14 +119,10 @@ QVariant DiveTripModelBase::tripData(const dive_trip *trip, int column, int role
switch (column) {
case DiveTripModelBase::NR:
QString shownText;
- bool oneDayTrip = trip_is_single_day(trip);
int countShown = trip_shown_dives(trip);
if (countShown < trip->dives.nr)
shownText = tr("(%1 shown)").arg(countShown);
- if (!empty_string(trip->location))
- return QString(trip->location) + ", " + get_trip_date_string(trip_date(trip), trip->dives.nr, oneDayTrip) + " "+ shownText;
- else
- return get_trip_date_string(trip_date(trip), trip->dives.nr, oneDayTrip) + shownText;
+ return get_trip_string(trip) + " " + shownText;
}
}