models: export dive guide in DiveTripModel

We might want to display that in the dive list.

Fixes #3382.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-02-12 14:35:22 +01:00 committed by Dirk Hohndel
parent f4c85eec04
commit b3c58e7172
3 changed files with 14 additions and 1 deletions

View file

@ -1,6 +1,7 @@
- dive list: make dive guide visible in dive list [#3382]
- general: rename dive master to dive guide
- desktop: Don't lose cursor position in notes when switching between windows [#3369] - desktop: Don't lose cursor position in notes when switching between windows [#3369]
- Uemis support: fix the ability disconnect/reconnect the Zurich when its filesystem is full - Uemis support: fix the ability disconnect/reconnect the Zurich when its filesystem is full
- general: rename dive master to dive guide
- libdivecomputer: add support for latest BLE hardware in OSTC dive computers - libdivecomputer: add support for latest BLE hardware in OSTC dive computers
--- ---

View file

@ -54,6 +54,7 @@ static QVariant dive_table_alignment(int column)
case DiveTripModelBase::PHOTOS: case DiveTripModelBase::PHOTOS:
case DiveTripModelBase::COUNTRY: case DiveTripModelBase::COUNTRY:
case DiveTripModelBase::BUDDIES: case DiveTripModelBase::BUDDIES:
case DiveTripModelBase::DIVEGUIDE:
case DiveTripModelBase::LOCATION: case DiveTripModelBase::LOCATION:
return int(Qt::AlignLeft | Qt::AlignVCenter); return int(Qt::AlignLeft | Qt::AlignVCenter);
} }
@ -296,6 +297,8 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role)
return QString(get_dive_country(d)); return QString(get_dive_country(d));
case BUDDIES: case BUDDIES:
return QString(d->buddy); return QString(d->buddy);
case DIVEGUIDE:
return QString(d->diveguide);
case LOCATION: case LOCATION:
return QString(get_dive_location(d)); return QString(get_dive_location(d));
case GAS: case GAS:
@ -360,6 +363,8 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role)
return tr("Country"); return tr("Country");
case BUDDIES: case BUDDIES:
return tr("Buddy"); return tr("Buddy");
case DIVEGUIDE:
return tr("Dive guide");
case LOCATION: case LOCATION:
return tr("Location"); return tr("Location");
} }
@ -427,6 +432,8 @@ QVariant DiveTripModelBase::headerData(int section, Qt::Orientation orientation,
return tr("Country"); return tr("Country");
case BUDDIES: case BUDDIES:
return tr("Buddy"); return tr("Buddy");
case DIVEGUIDE:
return tr("Dive guide");
case LOCATION: case LOCATION:
return tr("Location"); return tr("Location");
} }
@ -467,6 +474,8 @@ QVariant DiveTripModelBase::headerData(int section, Qt::Orientation orientation,
return tr("Media before/during/after dive"); return tr("Media before/during/after dive");
case BUDDIES: case BUDDIES:
return tr("Buddy"); return tr("Buddy");
case DIVEGUIDE:
return tr("Dive guide");
case LOCATION: case LOCATION:
return tr("Location"); return tr("Location");
} }
@ -1772,6 +1781,8 @@ bool DiveTripModelList::lessThan(const QModelIndex &i1, const QModelIndex &i2) c
return lessThanHelper(strCmp(get_dive_country(d1), get_dive_country(d2)), row_diff); return lessThanHelper(strCmp(get_dive_country(d1), get_dive_country(d2)), row_diff);
case BUDDIES: case BUDDIES:
return lessThanHelper(strCmp(d1->buddy, d2->buddy), row_diff); return lessThanHelper(strCmp(d1->buddy, d2->buddy), row_diff);
case DIVEGUIDE:
return lessThanHelper(strCmp(d1->diveguide, d2->diveguide), row_diff);
case LOCATION: case LOCATION:
return lessThanHelper(strCmp(get_dive_location(d1), get_dive_location(d2)), row_diff); return lessThanHelper(strCmp(get_dive_location(d1), get_dive_location(d2)), row_diff);
} }

View file

@ -40,6 +40,7 @@ public:
TAGS, TAGS,
PHOTOS, PHOTOS,
BUDDIES, BUDDIES,
DIVEGUIDE,
COUNTRY, COUNTRY,
LOCATION, LOCATION,
COLUMNS COLUMNS