diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vsession.cpp | 9 | ||||
-rw-r--r-- | src/xsession.cpp | 11 |
2 files changed, 14 insertions, 6 deletions
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<QString>& 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; diff --git a/src/xsession.cpp b/src/xsession.cpp index 3ae4320..ff5de57 100644 --- a/src/xsession.cpp +++ b/src/xsession.cpp @@ -149,6 +149,13 @@ bool XSession::operator<(const Session& other) const { return false; } -bool XSession::containsKeywords(const QList<QString>&) const { - return true; +bool XSession::containsKeywords(const QList<QString>& keywords) const { + for (int j = 0; j < keywords.length(); ++j) { + if (!this->shortDescription().contains(keywords[j], Qt::CaseInsensitive) + && !this->description().contains(keywords[j], Qt::CaseInsensitive)) { + return false; + } + } + return true; } + |