From fdbdcaab809c969cd4154ae67a717283c94feb9f Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 13 Nov 2014 17:10:33 -0200 Subject: Suits filterRow method done. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/filtermodels.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'qt-ui') 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(); + + return doFilter(d, index0, sourceModel); } void SuitsFilterModel::repopulate() -- cgit v1.2.3-70-g09d2