summaryrefslogtreecommitdiffstats
path: root/qt-models/divelistmodel.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-17 11:57:21 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-17 12:00:38 -0700
commitd595f5c167c7283dc22f902ed0b18a7d6da2221e (patch)
tree10efaa6874740510a90fb9144facd7abe86ab577 /qt-models/divelistmodel.cpp
parent76e61bd8d9baea008628bf5b176cf8f0b664e78f (diff)
parent0c9756c5d786158f25aaf1ad2d9c316be9e2b9e5 (diff)
downloadsubsurface-d595f5c167c7283dc22f902ed0b18a7d6da2221e.tar.gz
Merge branch 'devel' of https://github.com/gracie89/subsurface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/divelistmodel.cpp')
-rw-r--r--qt-models/divelistmodel.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index 0fb1cbbf9..8bb895fc8 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -5,6 +5,7 @@ MobileDive::MobileDive(dive *d)
{
m_thisDive = d;
setDiveNumber(QString::number(d->number));
+ setDiveId(QString::number(d->id));
dive_trip *trip = d->divetrip;
@@ -216,6 +217,16 @@ void MobileDive::setupDiveTempDetails()
setWatertemp(get_temperature_string(m_thisDive->watertemp, true));
setAirTemp(get_temperature_string(m_thisDive->airtemp, true));
}
+QString MobileDive::diveId() const
+{
+ return m_diveId;
+}
+
+void MobileDive::setDiveId(const QString &diveId)
+{
+ m_diveId = diveId;
+}
+
@@ -283,6 +294,8 @@ QVariant DiveListModel::data(const QModelIndex &index, int role) const
return dive.buddy();
else if (role == DiveMasterRole)
return dive.divemaster();
+ else if (role == DiveIdRole)
+ return dive.diveId();
return QVariant();
@@ -308,6 +321,7 @@ QHash<int, QByteArray> DiveListModel::roleNames() const
roles[DiveNotesRole] = "notes";
roles[DiveBuddyRole] = "buddy";
roles[DiveMasterRole] = "divemaster";
+ roles[DiveIdRole] = "id";
return roles;
}