X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fignorelistmanager.cpp;h=99a9b187b97236a2322ff9c1f93a50317d6d38b8;hp=24fae94316888d3faf5a875b0ff4a38e462c3811;hb=16f22647e6890d3eb8c3e94f7a0700e12fa29e44;hpb=694f9bfbf7f1af19108461c7e00d133e55082bce diff --git a/src/common/ignorelistmanager.cpp b/src/common/ignorelistmanager.cpp index 24fae943..99a9b187 100644 --- a/src/common/ignorelistmanager.cpp +++ b/src/common/ignorelistmanager.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-09 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 * @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "ignorelistmanager.h" @@ -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; }