summaryrefslogtreecommitdiffstats
path: root/src/xsession.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2016-01-19 16:58:38 +0100
committerSimon Rettberg2016-01-19 16:58:38 +0100
commit6f642343588060a9dc4b2ddce2c25e5abc9189ea (patch)
tree90cc02a5456d59e01aa10820efd8b03c07150560 /src/xsession.cpp
parentAdd support for locations query (diff)
downloadvmchooser2-6f642343588060a9dc4b2ddce2c25e5abc9189ea.tar.gz
vmchooser2-6f642343588060a9dc4b2ddce2c25e5abc9189ea.tar.xz
vmchooser2-6f642343588060a9dc4b2ddce2c25e5abc9189ea.zip
Fix filter logic
Diffstat (limited to 'src/xsession.cpp')
-rw-r--r--src/xsession.cpp11
1 files changed, 9 insertions, 2 deletions
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;
}
+