mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 05:38:06 -06:00
Use QRegularExpression instead of deprecated QRegExp
Now it follows closely the definition of wildcard for glob patterns. The backslash (\) character is not an escape char in this context. In order to match one of the special characters, place it in square brackets (for example, [?]).
This commit is contained in:
@@ -365,9 +365,9 @@ void SearchJobWidget::fillFilterComboBoxes()
|
||||
|
||||
void SearchJobWidget::filterSearchResults(const QString &name)
|
||||
{
|
||||
const QRegExp::PatternSyntax patternSyntax = Preferences::instance()->getRegexAsFilteringPatternForSearchJob()
|
||||
? QRegExp::RegExp : QRegExp::WildcardUnix;
|
||||
m_proxyModel->setFilterRegExp(QRegExp(name, Qt::CaseInsensitive, patternSyntax));
|
||||
const QString pattern = (Preferences::instance()->getRegexAsFilteringPatternForSearchJob()
|
||||
? name : Utils::String::wildcardToRegexPattern(name));
|
||||
m_proxyModel->setFilterRegularExpression(QRegularExpression(pattern, QRegularExpression::CaseInsensitiveOption));
|
||||
updateResultsCount();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user