summaryrefslogtreecommitdiffstats
path: root/qt-models/filtermodels.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-14 13:03:33 -0400
committerGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-14 13:03:33 -0400
commitfb47c15cd81970f19aeb9777c4c576b973889674 (patch)
tree23845588c6fe9fcb09bc7f46e06ae24fe5882a2f /qt-models/filtermodels.cpp
parent612f1b478f785331504fc4a22c1546536d2f345f (diff)
downloadsubsurface-fb47c15cd81970f19aeb9777c4c576b973889674.tar.gz
Filter: remove unused parameters from doFilter functions
Change the signature from of the virtual doFilter() functions from bool doFilter(struct dive *d, QModelIndex&, QAbstractItemModel*) const; to bool LocationFilterModel::doFilter(struct dive *d) const; as the QModelIndex and QAbstractItemModel parameters were not used. This makes this functions independent from Qt's model/view framework. This is in preparation for making the undo-machinery compatible with the filtering. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/filtermodels.cpp')
-rw-r--r--qt-models/filtermodels.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index 12d755dc1..bd95e0ad9 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -132,7 +132,7 @@ int SuitsFilterModel::countDives(const char *s) const
return count_dives_with_suit(s);
}
-bool SuitsFilterModel::doFilter(dive *d, QModelIndex&, QAbstractItemModel*) const
+bool SuitsFilterModel::doFilter(dive *d) const
{
// rowCount() == 0 should never happen, because we have the "no suits" row
// let's handle it gracefully anyway.
@@ -196,7 +196,7 @@ void TagFilterModel::repopulate()
updateList(list);
}
-bool TagFilterModel::doFilter(dive *d, QModelIndex&, QAbstractItemModel*) const
+bool TagFilterModel::doFilter(dive *d) const
{
// If there's nothing checked, this should show everything
// rowCount() == 0 should never happen, because we have the "no tags" row
@@ -234,7 +234,7 @@ int BuddyFilterModel::countDives(const char *s) const
return count_dives_with_person(s);
}
-bool BuddyFilterModel::doFilter(dive *d, QModelIndex&, QAbstractItemModel*) const
+bool BuddyFilterModel::doFilter(dive *d) const
{
// If there's nothing checked, this should show everything
// rowCount() == 0 should never happen, because we have the "no tags" row
@@ -289,7 +289,7 @@ int LocationFilterModel::countDives(const char *s) const
return count_dives_with_location(s);
}
-bool LocationFilterModel::doFilter(struct dive *d, QModelIndex&, QAbstractItemModel*) const
+bool LocationFilterModel::doFilter(struct dive *d) const
{
// rowCount() == 0 should never happen, because we have the "no location" row
// let's handle it gracefully anyway.
@@ -412,7 +412,7 @@ bool MultiFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &s
return showTrip;
}
Q_FOREACH (FilterModelBase *model, models) {
- if (!model->doFilter(d, index0, sourceModel()))
+ if (!model->doFilter(d))
shouldShow = false;
}