diff options
author | Nils Schwabe | 2014-03-21 17:30:03 +0100 |
---|---|---|
committer | Nils Schwabe | 2014-03-21 17:30:03 +0100 |
commit | b72f1d53558344392daa916f69ece7db8c7a9d89 (patch) | |
tree | eb40fbd424b7f51c9ae3b34a6e09088e151985b9 /src/vsession.cpp | |
parent | - display the keywords in the desciption box (diff) | |
download | vmchooser2-b72f1d53558344392daa916f69ece7db8c7a9d89.tar.gz vmchooser2-b72f1d53558344392daa916f69ece7db8c7a9d89.tar.xz vmchooser2-b72f1d53558344392daa916f69ece7db8c7a9d89.zip |
added functionality to filter box
Diffstat (limited to 'src/vsession.cpp')
-rw-r--r-- | src/vsession.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vsession.cpp b/src/vsession.cpp index ba7a478..e8e301e 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -82,6 +82,24 @@ 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; + for (int i = 0; i < this->keywords().length(); ++i) { + if (this->keywords()[i].contains(keywords[j], Qt::CaseInsensitive)) { + keywordFlag = true; + } + } + if (!keywordFlag) return false; + } + } + return true; +} + QString VSession::getNodeText(const QString& nodeName) const { return this->doc_.namedItem(nodeName).toText().data(); } |