Use Perl-compatible regexes for RSS rules. Closes #6367.

--HG--
branch : magao-dev
This commit is contained in:
Tim Delaney 2017-02-11 16:33:18 +11:00
parent d045f64ebb
commit f9abd254f4
6 changed files with 81 additions and 42 deletions

View file

@ -37,6 +37,7 @@
#ifdef QBT_USES_QT5
#include <QCollator>
#endif
#include <QRegExp>
#ifdef Q_OS_MAC
#include <QThreadStorage>
#endif
@ -211,3 +212,13 @@ bool Utils::String::slowEquals(const QByteArray &a, const QByteArray &b)
return (diff == 0);
}
// This is marked as internal in QRegExp.cpp, but is exported. The alternative would be to
// copy the code from QRegExp::wc2rx().
QString qt_regexp_toCanonical(const QString &pattern, QRegExp::PatternSyntax patternSyntax);
QString Utils::String::wildcardToRegex(const QString &pattern)
{
return qt_regexp_toCanonical(pattern, QRegExp::Wildcard);
}