X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fignorelistmanager.cpp;h=99a9b187b97236a2322ff9c1f93a50317d6d38b8;hb=61aac1868f15babb7086d8bc6bbcff530346f438;hp=a6fbd161dc8c58c055d6442481390afd980b7494;hpb=9d54503555534a2c554f09a33df6afa33d6308ec;p=quassel.git diff --git a/src/common/ignorelistmanager.cpp b/src/common/ignorelistmanager.cpp index a6fbd161..99a9b187 100644 --- a/src/common/ignorelistmanager.cpp +++ b/src/common/ignorelistmanager.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2014 by the Quassel Project * + * Copyright (C) 2005-2016 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -23,7 +23,6 @@ #include #include #include -#include INIT_SYNCABLE_OBJECT(IgnoreListManager) IgnoreListManager &IgnoreListManager::operator=(const IgnoreListManager &other) @@ -92,7 +91,7 @@ void IgnoreListManager::initSetIgnoreList(const QVariantMap &ignoreList) int count = ignoreRule.count(); if (count != scopeRule.count() || count != isRegEx.count() || count != scope.count() || count != strictness.count() || count != ignoreType.count() || count != isActive.count()) { - qWarning() << "Corrupted IgnoreList settings! (Count missmatch)"; + qWarning() << "Corrupted IgnoreList settings! (Count mismatch)"; return; } @@ -145,19 +144,13 @@ IgnoreListManager::StrictnessType IgnoreListManager::_match(const QString &msgCo else str = msgSender; - QRegExp ruleRx = QRegExp(item.ignoreRule); - ruleRx.setCaseSensitivity(Qt::CaseInsensitive); - if (!item.isRegEx) { - ruleRx.setPatternSyntax(QRegExp::Wildcard); - } - // qDebug() << "IgnoreListManager::match: "; // qDebug() << "string: " << str; // qDebug() << "pattern: " << ruleRx.pattern(); // qDebug() << "scopeRule: " << item.scopeRule; // qDebug() << "now testing"; - if ((!item.isRegEx && ruleRx.exactMatch(str)) || - (item.isRegEx && ruleRx.indexIn(str) != -1)) { + if ((!item.isRegEx && item.regEx.exactMatch(str)) || + (item.isRegEx && item.regEx.indexIn(str) != -1)) { // qDebug() << "MATCHED!"; return item.strictness; }