diff options
author | Simon Rettberg | 2016-01-19 16:58:38 +0100 |
---|---|---|
committer | Simon Rettberg | 2016-01-19 16:58:38 +0100 |
commit | 6f642343588060a9dc4b2ddce2c25e5abc9189ea (patch) | |
tree | 90cc02a5456d59e01aa10820efd8b03c07150560 /src/xsession.cpp | |
parent | Add support for locations query (diff) | |
download | vmchooser2-6f642343588060a9dc4b2ddce2c25e5abc9189ea.tar.gz vmchooser2-6f642343588060a9dc4b2ddce2c25e5abc9189ea.tar.xz vmchooser2-6f642343588060a9dc4b2ddce2c25e5abc9189ea.zip |
Fix filter logic
Diffstat (limited to 'src/xsession.cpp')
-rw-r--r-- | src/xsession.cpp | 11 |
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; } + |