summaryrefslogtreecommitdiffstats
path: root/src/vsession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vsession.cpp')
-rw-r--r--src/vsession.cpp18
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();
}