Cleanup: remove DiveTripModelBase::SHOWN_ROLE

This role was used by the filter-proxy model as filter criterion.
Since we don't use that model to filter anymore, we can remove
the role.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-02-10 20:56:26 +01:00 committed by Dirk Hohndel
parent ae5d2e6b45
commit 03a6440b2a
2 changed files with 0 additions and 11 deletions

View file

@ -841,14 +841,6 @@ void DiveTripModelTree::divesHidden(dive_trip *trip, const QVector<dive *> &dive
QVariant DiveTripModelTree::data(const QModelIndex &index, int role) const
{
if (role == SHOWN_ROLE) {
QModelIndex parent = index.parent();
// An invalid parent means that we're at the top-level
if (!parent.isValid())
return items[index.row()].shown;
return !items[parent.row()].dives[index.row()]->hidden_by_filter;
}
// Set the font for all items alike
if (role == Qt::FontRole)
return defaultModelFont();
@ -1409,8 +1401,6 @@ QVariant DiveTripModelList::data(const QModelIndex &index, int role) const
return defaultModelFont();
dive *d = diveOrNull(index);
if (role == SHOWN_ROLE)
return d && !d->hidden_by_filter;
return d ? diveData(d, index.column(), role) : QVariant();
}

View file

@ -49,7 +49,6 @@ public:
DIVE_ROLE,
TRIP_ROLE,
DIVE_IDX,
SHOWN_ROLE,
SELECTED_ROLE
};
enum Layout {