From 03a6440b2a1001d0ab1ff7958d42217dd07b1603 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 10 Feb 2020 20:56:26 +0100 Subject: 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 --- qt-models/divetripmodel.cpp | 10 ---------- qt-models/divetripmodel.h | 1 - 2 files changed, 11 deletions(-) (limited to 'qt-models') diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index 33c087a5a..23292384e 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -841,14 +841,6 @@ void DiveTripModelTree::divesHidden(dive_trip *trip, const QVector &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(); } diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h index ba6ba9600..4182f0bd1 100644 --- a/qt-models/divetripmodel.h +++ b/qt-models/divetripmodel.h @@ -49,7 +49,6 @@ public: DIVE_ROLE, TRIP_ROLE, DIVE_IDX, - SHOWN_ROLE, SELECTED_ROLE }; enum Layout { -- cgit v1.2.3-70-g09d2