aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/filtermodels.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/qt-ui/filtermodels.cpp b/qt-ui/filtermodels.cpp
index 6c80ca55f..4ed2948ec 100644
--- a/qt-ui/filtermodels.cpp
+++ b/qt-ui/filtermodels.cpp
@@ -82,7 +82,16 @@ bool SuitsFilterModel::doFilter(dive *d, QModelIndex &index0, QAbstractItemModel
bool SuitsFilterModel::filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const
{
- return false;
+ // If there's nothing checked, this should show everything
+ if (!anyChecked) {
+ return true;
+ }
+
+ QModelIndex index0 = sourceModel->index(source_row, 0, source_parent);
+ QVariant diveVariant = sourceModel->data(index0, DiveTripModel::DIVE_ROLE);
+ struct dive *d = (struct dive *)diveVariant.value<void *>();
+
+ return doFilter(d, index0, sourceModel);
}
void SuitsFilterModel::repopulate()