diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-11-13 17:10:33 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-13 12:06:08 -0800 |
commit | fdbdcaab809c969cd4154ae67a717283c94feb9f (patch) | |
tree | 33c6dba8a894d34a9cb6e98ab6ce3b688a50d61c /qt-ui | |
parent | bfdd94ddc3909ab015db5658a2391a58ce9ea84a (diff) | |
download | subsurface-fdbdcaab809c969cd4154ae67a717283c94feb9f.tar.gz |
Suits filterRow method done.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/filtermodels.cpp | 11 |
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() |