From e6ec626c9758d30c3f714ddbf6f79195e710e037 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 2 May 2013 09:33:51 -0700 Subject: [PATCH] Show trip date (with number of dives) in dive/trip list That was easy :-) Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index dd2cf2f84..12a0398a0 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -404,13 +404,15 @@ QVariant TripItem::data(int column, int role) const { QVariant ret; - if (column != LOCATION) { - return ret; - } - - switch (role) { - case Qt::DisplayRole: - ret = QString(trip->location); + if (role == Qt::DisplayRole) { + switch (column) { + case LOCATION: + ret = QString(trip->location); + break; + case DATE: + ret = QString(get_trip_date_string(trip->when, trip->nrdives)); + break; + } } return ret;