mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 06:02:29 -06:00
Use Perl-compatible regexes for RSS rules. Closes #6367.
--HG-- branch : magao-dev
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ namespace Utils
|
||||
|
||||
bool naturalCompareCaseSensitive(const QString &left, const QString &right);
|
||||
bool naturalCompareCaseInsensitive(const QString &left, const QString &right);
|
||||
|
||||
QString wildcardToRegex(const QString &pattern);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user