/***************************************************************************
- * Copyright (C) 2005-2012 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 *
#include <QtCore>
#include <QDebug>
#include <QStringList>
-#include <QRegExp>
INIT_SYNCABLE_OBJECT(IgnoreListManager)
IgnoreListManager &IgnoreListManager::operator=(const IgnoreListManager &other)
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;
}
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;
}