mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive d/l selection UI: Display the downloaded dives in a table
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f7abde84af
commit
76725265fc
1 changed files with 16 additions and 1 deletions
|
@ -514,9 +514,24 @@ int DiveImportedModel::rowCount(const QModelIndex& model) const
|
||||||
return lastIndex - firstIndex;
|
return lastIndex - firstIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant DiveImportedModel::data(const QModelIndex& model, int role) const
|
QVariant DiveImportedModel::data(const QModelIndex& index, int role) const
|
||||||
{
|
{
|
||||||
|
if (!index.isValid())
|
||||||
|
return QVariant();
|
||||||
|
|
||||||
|
if (index.row() + firstIndex > lastIndex)
|
||||||
|
return QVariant();
|
||||||
|
|
||||||
|
struct dive* d = get_dive( index.row() + firstIndex);
|
||||||
|
if (role == Qt::DisplayRole) {
|
||||||
|
switch(index.column()){
|
||||||
|
case 0 : return QVariant(d->when);
|
||||||
|
case 1 : return QVariant(d->duration);
|
||||||
|
case 2 : return QVariant(d->maxdepth);
|
||||||
|
case 3 : return QVariant(d->latitude);
|
||||||
|
case 4 : return QVariant(d->longitude);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveImportedModel::setImportedDivesIndexes(int first, int last)
|
void DiveImportedModel::setImportedDivesIndexes(int first, int last)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue