mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
06c35026d6
commit
f4ee893424
3 changed files with 14 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue