Fixes in the buddy finding algorithm.

I was comparing the strings in the opposite direction.

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-10-31 16:54:37 -02:00 committed by Dirk Hohndel
parent 358611d029
commit 2827da5ecf

View file

@ -2397,7 +2397,7 @@ bool BuddyFilterModel::filterRow(int source_row, const QModelIndex &source_paren
if (!buddyList.isEmpty()) { if (!buddyList.isEmpty()) {
buddyList.removeLast(); // remove the "Show Empty Tags"; buddyList.removeLast(); // remove the "Show Empty Tags";
for(int i = 0; i < rowCount(); i++){ for(int i = 0; i < rowCount(); i++){
if(checkState[i] && stringList()[i].indexOf(diveBuddy) != -1){ if(checkState[i] && diveBuddy.indexOf(stringList()[i]) != -1){
return true; return true;
} }
} }
@ -2476,13 +2476,14 @@ bool MultiFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &s
return true; return true;
} }
bool shouldShow = true;
Q_FOREACH (MultiFilterInterface *model, models) { Q_FOREACH (MultiFilterInterface *model, models) {
if (model->filterRow(source_row, source_parent, sourceModel())) { if (!model->filterRow(source_row, source_parent, sourceModel())) {
return true; shouldShow = false;
} }
} }
return false; return shouldShow;
} }
void MultiFilterSortModel::myInvalidate() void MultiFilterSortModel::myInvalidate()