Dive site: fix oversight in 920eb7576f

In commit 920eb7576f "dive_site *"
was included in Qt's "metatype" system to be able to pass it
through QVariants. One instance was forgotten and a "void *"
was passed in. On readout NULL was returned, which made it
impossible to add new dive-sites under certain circumstances.

Convert this one instance to a proper "dive_site *" QVariant.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-10-30 18:34:36 +01:00 committed by Dirk Hohndel
parent 3e838ee74d
commit dec9401f48

View file

@ -381,7 +381,7 @@ QVariant DiveLocationModel::data(const QModelIndex &index, int role) const
if (index.row() <= 1) { // two special cases.
if (index.column() == LocationInformationModel::DIVESITE)
return QVariant::fromValue<void *>(RECENTLY_ADDED_DIVESITE);
return QVariant::fromValue<dive_site *>(RECENTLY_ADDED_DIVESITE);
switch (role) {
case Qt::DisplayRole:
return new_ds_value[index.row()];