diff options
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/divelistmodel.cpp | 3 | ||||
-rw-r--r-- | qt-models/divelistmodel.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp index 05cf987c9..9c67ced8d 100644 --- a/qt-models/divelistmodel.cpp +++ b/qt-models/divelistmodel.cpp @@ -257,6 +257,8 @@ QVariant DiveListModel::data(const QModelIndex &index, int role) const case IdRole: return d->id; case NumberRole: return d->number; case LocationRole: return get_dive_location(d); + case DepthDurationRole: return QStringLiteral("%1 / %2").arg(get_depth_string(d->dc.maxdepth.mm, true, true), + get_dive_duration_string(d->duration.seconds, gettextFromC::tr("h"), gettextFromC::tr("min"))); } return QVariant(); } @@ -272,6 +274,7 @@ QHash<int, QByteArray> DiveListModel::roleNames() const roles[IdRole] = "id"; roles[NumberRole] = "number"; roles[LocationRole] = "location"; + roles[DepthDurationRole] = "depthDuration"; return roles; } diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h index 9e706dd3d..adda8b127 100644 --- a/qt-models/divelistmodel.h +++ b/qt-models/divelistmodel.h @@ -44,6 +44,7 @@ public: IdRole, NumberRole, LocationRole, + DepthDurationRole, }; static DiveListModel *instance(); |