mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
Merge pull request #14628 from sledgehammer999/qt_511
Lower Qt requirement to 5.11
This commit is contained in:
@@ -825,8 +825,7 @@ void PropertiesWidget::filteredFilesChanged()
|
||||
|
||||
void PropertiesWidget::filterText(const QString &filter)
|
||||
{
|
||||
const QString pattern = Utils::String::wildcardToRegexPattern(filter);
|
||||
m_propListModel->setFilterRegularExpression(QRegularExpression(pattern, QRegularExpression::CaseInsensitiveOption));
|
||||
m_propListModel->setFilterRegExp(QRegExp(filter, Qt::CaseInsensitive, QRegExp::WildcardUnix));
|
||||
if (filter.isEmpty())
|
||||
{
|
||||
m_ui->filesList->collapseAll();
|
||||
|
||||
@@ -719,14 +719,10 @@ void AutomatedRssDownloader::updateMustLineValidity()
|
||||
{
|
||||
QStringList tokens;
|
||||
if (isRegex)
|
||||
{
|
||||
tokens << text;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (const QString &token : asConst(text.split('|')))
|
||||
tokens << Utils::String::wildcardToRegexPattern(token);
|
||||
}
|
||||
tokens << Utils::String::wildcardToRegex(token);
|
||||
|
||||
for (const QString &token : asConst(tokens))
|
||||
{
|
||||
@@ -766,14 +762,10 @@ void AutomatedRssDownloader::updateMustNotLineValidity()
|
||||
{
|
||||
QStringList tokens;
|
||||
if (isRegex)
|
||||
{
|
||||
tokens << text;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (const QString &token : asConst(text.split('|')))
|
||||
tokens << Utils::String::wildcardToRegexPattern(token);
|
||||
}
|
||||
tokens << Utils::String::wildcardToRegex(token);
|
||||
|
||||
for (const QString &token : asConst(tokens))
|
||||
{
|
||||
|
||||
@@ -365,9 +365,9 @@ void SearchJobWidget::fillFilterComboBoxes()
|
||||
|
||||
void SearchJobWidget::filterSearchResults(const QString &name)
|
||||
{
|
||||
const QString pattern = (Preferences::instance()->getRegexAsFilteringPatternForSearchJob()
|
||||
? name : Utils::String::wildcardToRegexPattern(name));
|
||||
m_proxyModel->setFilterRegularExpression(QRegularExpression(pattern, QRegularExpression::CaseInsensitiveOption));
|
||||
const QRegExp::PatternSyntax patternSyntax = Preferences::instance()->getRegexAsFilteringPatternForSearchJob()
|
||||
? QRegExp::RegExp : QRegExp::WildcardUnix;
|
||||
m_proxyModel->setFilterRegExp(QRegExp(name, Qt::CaseInsensitive, patternSyntax));
|
||||
updateResultsCount();
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ bool TorrentContentFilterModel::hasFiltered(const QModelIndex &folder) const
|
||||
// this should be called only with folders
|
||||
// check if the folder name itself matches the filter string
|
||||
QString name = folder.data().toString();
|
||||
if (name.contains(filterRegularExpression()))
|
||||
if (name.contains(filterRegExp()))
|
||||
return true;
|
||||
for (int child = 0; child < m_model->rowCount(folder); ++child)
|
||||
{
|
||||
@@ -141,7 +141,7 @@ bool TorrentContentFilterModel::hasFiltered(const QModelIndex &folder) const
|
||||
continue;
|
||||
}
|
||||
name = childIndex.data().toString();
|
||||
if (name.contains(filterRegularExpression()))
|
||||
if (name.contains(filterRegExp()))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <QHeaderView>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
#include <QSet>
|
||||
#include <QShortcut>
|
||||
@@ -1130,9 +1131,9 @@ void TransferListWidget::applyTrackerFilter(const QSet<BitTorrent::TorrentID> &t
|
||||
|
||||
void TransferListWidget::applyNameFilter(const QString &name)
|
||||
{
|
||||
const QString pattern = (Preferences::instance()->getRegexAsFilteringPatternForTransferList()
|
||||
? name : Utils::String::wildcardToRegexPattern(name));
|
||||
m_sortFilterModel->setFilterRegularExpression(QRegularExpression(pattern, QRegularExpression::CaseInsensitiveOption));
|
||||
const QRegExp::PatternSyntax patternSyntax = Preferences::instance()->getRegexAsFilteringPatternForTransferList()
|
||||
? QRegExp::RegExp : QRegExp::WildcardUnix;
|
||||
m_sortFilterModel->setFilterRegExp(QRegExp(name, Qt::CaseInsensitive, patternSyntax));
|
||||
}
|
||||
|
||||
void TransferListWidget::applyStatusFilter(int f)
|
||||
|
||||
Reference in New Issue
Block a user