mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
[Divesite] Hook qt model for country
See #144 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
516527e1bd
commit
d5ab03ef4e
2 changed files with 19 additions and 0 deletions
|
@ -36,6 +36,7 @@ static QVariant dive_table_alignment(int column)
|
|||
case DiveTripModel::CYLINDER:
|
||||
case DiveTripModel::GAS:
|
||||
case DiveTripModel::PHOTOS:
|
||||
case DiveTripModel::COUNTRY:
|
||||
case DiveTripModel::LOCATION:
|
||||
retVal = int(Qt::AlignLeft | Qt::AlignVCenter);
|
||||
break;
|
||||
|
@ -137,6 +138,9 @@ QVariant DiveItem::data(int column, int role) const
|
|||
case PHOTOS:
|
||||
retVal = countPhotos(dive);
|
||||
break;
|
||||
case COUNTRY:
|
||||
retVal = QString(get_dive_country(dive));
|
||||
break;
|
||||
case LOCATION:
|
||||
retVal = QString(get_dive_location(dive));
|
||||
break;
|
||||
|
@ -180,6 +184,9 @@ QVariant DiveItem::data(int column, int role) const
|
|||
break;
|
||||
case PHOTOS:
|
||||
break;
|
||||
case COUNTRY:
|
||||
retVal = QString(get_dive_country(dive));
|
||||
break;
|
||||
case LOCATION:
|
||||
retVal = QString(get_dive_location(dive));
|
||||
break;
|
||||
|
@ -192,6 +199,10 @@ QVariant DiveItem::data(int column, int role) const
|
|||
break;
|
||||
case Qt::DecorationRole:
|
||||
switch (column) {
|
||||
//TODO: ADD A FLAG
|
||||
case COUNTRY:
|
||||
retVal = QVariant();
|
||||
break;
|
||||
case LOCATION:
|
||||
if (dive_has_gps_location(dive)) {
|
||||
IconMetrics im = defaultIconMetrics();
|
||||
|
@ -253,6 +264,9 @@ QVariant DiveItem::data(int column, int role) const
|
|||
case PHOTOS:
|
||||
retVal = tr("Photos before/during/after dive");
|
||||
break;
|
||||
case COUNTRY:
|
||||
retVal = tr("Country");
|
||||
break;
|
||||
case LOCATION:
|
||||
retVal = tr("Location");
|
||||
break;
|
||||
|
@ -461,6 +475,9 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int
|
|||
case PHOTOS:
|
||||
ret = tr("Photos");
|
||||
break;
|
||||
case COUNTRY:
|
||||
ret = tr("Country");
|
||||
break;
|
||||
case LOCATION:
|
||||
ret = tr("Location");
|
||||
break;
|
||||
|
|
|
@ -24,6 +24,7 @@ public:
|
|||
OTU,
|
||||
MAXCNS,
|
||||
PHOTOS,
|
||||
COUNTRY,
|
||||
LOCATION,
|
||||
COLUMNS
|
||||
};
|
||||
|
@ -69,6 +70,7 @@ public:
|
|||
OTU,
|
||||
MAXCNS,
|
||||
PHOTOS,
|
||||
COUNTRY,
|
||||
LOCATION,
|
||||
COLUMNS
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue