summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-10-31 16:54:37 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-31 14:58:56 -0700
commit2827da5ecfaa77c41b391c2b0fc85c0605ea1568 (patch)
tree20d689e896a15a82505c8dd8d57c1e0626dc9858 /qt-ui/models.cpp
parent358611d029c68a3f402b8387f34946ac6acb64e7 (diff)
downloadsubsurface-2827da5ecfaa77c41b391c2b0fc85c0605ea1568.tar.gz
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>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index be3a94a0e..74d5ec6a4 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -2397,7 +2397,7 @@ bool BuddyFilterModel::filterRow(int source_row, const QModelIndex &source_paren
if (!buddyList.isEmpty()) {
buddyList.removeLast(); // remove the "Show Empty Tags";
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;
}
}
@@ -2476,13 +2476,14 @@ bool MultiFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &s
return true;
}
+ bool shouldShow = true;
Q_FOREACH (MultiFilterInterface *model, models) {
- if (model->filterRow(source_row, source_parent, sourceModel())) {
- return true;
+ if (!model->filterRow(source_row, source_parent, sourceModel())) {
+ shouldShow = false;
}
}
- return false;
+ return shouldShow;
}
void MultiFilterSortModel::myInvalidate()