aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-02 09:33:51 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-02 09:33:51 -0700
commite6ec626c9758d30c3f714ddbf6f79195e710e037 (patch)
tree2bbccb1a8157233779300caf508338befc3b3317 /qt-ui
parent6b7797140bcf706b1a0a2eeb70438d8572372b9f (diff)
downloadsubsurface-e6ec626c9758d30c3f714ddbf6f79195e710e037.tar.gz
Show trip date (with number of dives) in dive/trip list
That was easy :-) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/models.cpp16
1 files 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;