From 6f642343588060a9dc4b2ddce2c25e5abc9189ea Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 19 Jan 2016 16:58:38 +0100 Subject: Fix filter logic --- src/vsession.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/vsession.cpp') diff --git a/src/vsession.cpp b/src/vsession.cpp index 45587f1..79d3956 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -134,17 +134,18 @@ void VSession::readKeywords() { bool VSession::containsKeywords(const QList& keywords) const { for (int j = 0; j < keywords.length(); ++j) { - bool keywordFlag = true; if (!this->shortDescription().contains(keywords[j], Qt::CaseInsensitive) && !this->description().contains(keywords[j], Qt::CaseInsensitive) && !this->getAttribute("creator", "param").contains(keywords[j], Qt::CaseInsensitive)) { - keywordFlag = false; + bool match = false; for (int i = 0; i < this->keywords().length(); ++i) { if (this->keywords()[i].contains(keywords[j], Qt::CaseInsensitive)) { - keywordFlag = true; + match = true; + break; } } - if (!keywordFlag) return false; + if (!match) + return false; } } return true; -- cgit v1.2.3-55-g7522