Implement the data method for location information

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-05-17 16:45:51 -03:00 committed by Dirk Hohndel
parent 8115855428
commit 3235dd842e

View file

@ -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()