summaryrefslogtreecommitdiffstats
path: root/qt-ui/filtermodels.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-11-16 14:04:06 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-16 18:34:47 +0000
commit7c5c38b154baeeb05d2c70a3c248cda41349133a (patch)
tree4084a8661d50e536f96eb9e98e327ee25a1bcc27 /qt-ui/filtermodels.cpp
parent7967d2bec1f90f230800ada64c7fe69b3f2009cd (diff)
downloadsubsurface-7c5c38b154baeeb05d2c70a3c248cda41349133a.tar.gz
Addded a min / max layout for the filter, and a filter count
But the filter count seems to be broken for some reason and I really don't know why. It seems to work for tags, but not for everything else. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/filtermodels.cpp')
-rw-r--r--qt-ui/filtermodels.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/qt-ui/filtermodels.cpp b/qt-ui/filtermodels.cpp
index 5b2553d96..6751a8cfe 100644
--- a/qt-ui/filtermodels.cpp
+++ b/qt-ui/filtermodels.cpp
@@ -379,7 +379,7 @@ bool MultiFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &s
if (!model->doFilter(d, index0, sourceModel()))
shouldShow = false;
}
- // if it's a dive, mark it accordingly
+
filter_dive(d, shouldShow);
return shouldShow;
}
@@ -390,7 +390,11 @@ void MultiFilterSortModel::myInvalidate()
struct dive *d;
DiveListView *dlv = MainWindow::instance()->dive_list();
+ divesDisplayed = 0;
+ divesFilteredOut = 0;
+
invalidate();
+
// first make sure the trips are no longer shown as selected
// (but without updating the selection state of the dives... this just cleans
// up an oddity in the filter handling)
@@ -412,6 +416,15 @@ void MultiFilterSortModel::myInvalidate()
}
dlv->selectDives(curSelectedDives);
}
+
+ for_each_dive (i,d) {
+ if (d->hidden_by_filter)
+ divesFilteredOut++;
+ else
+ divesDisplayed++;
+ }
+
+ emit filterFinished();
}
void MultiFilterSortModel::addFilterModel(MultiFilterInterface *model)