summaryrefslogtreecommitdiffstats
path: root/qt-ui/locationinformation.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-05-17 16:45:51 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-17 13:52:23 -0700
commit3235dd842ebd41b189fa328dd1145b68083f2f95 (patch)
treee1422acb9e34946029efdcef756735aa424d1ca4 /qt-ui/locationinformation.cpp
parent81158554280420224b99ac172ed20ffed4fd9f11 (diff)
downloadsubsurface-3235dd842ebd41b189fa328dd1145b68083f2f95.tar.gz
Implement the data method for location information
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.cpp')
-rw-r--r--qt-ui/locationinformation.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index 38c1492f7..22f959cda 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -18,7 +18,15 @@ int LocationInformationModel::rowCount(const QModelIndex &parent) const
QVariant LocationInformationModel::data(const QModelIndex &index, int role) const
{
+ if (!index.isValid())
+ return QVariant();
+ struct dive_site *ds = get_dive_site(index.row());
+ switch(role) {
+ case Qt::DisplayRole : return qPrintable(ds->name);
+ }
+
+ return QVariant();
}
void LocationInformationModel::update()