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/xsession.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/xsession.cpp') 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&) const { - return true; +bool XSession::containsKeywords(const QList& 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; } + -- cgit v1.2.3-55-g7522