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>
This commit is contained in:
Tomaz Canabrava 2014-11-16 14:04:06 -02:00 committed by Dirk Hohndel
parent 7967d2bec1
commit 7c5c38b154
6 changed files with 181 additions and 35 deletions

View file

@ -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)