Use helper function empty_string() instead of manual checks
For code consistency, substitute boolean expressions: s && *s -> !empty_string(s) s && s[0] -> !empty_string(s) !s || !*s -> empty_string(s) !s || !s[0] -> empty_string(s) Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
committed by
Lubomir I. Ivanov
parent
e85ecdd925
commit
6a07ccbad2
@@ -70,7 +70,7 @@ QVariant TripItem::data(int column, int role) const
|
||||
}
|
||||
if (countShown < trip->nrdives)
|
||||
shownText = tr("(%1 shown)").arg(countShown);
|
||||
if (trip->location && *trip->location)
|
||||
if (!empty_string(trip->location))
|
||||
ret = QString(trip->location) + ", " + get_trip_date_string(trip->when, trip->nrdives, oneDayTrip) + " "+ shownText;
|
||||
else
|
||||
ret = get_trip_date_string(trip->when, trip->nrdives, oneDayTrip) + shownText;
|
||||
|
||||
Reference in New Issue
Block a user