1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

Rename 2 methods to eliminate ambiguity

This commit is contained in:
thalieht 2018-08-12 17:46:16 +03:00
parent 4dcb0b922e
commit 400eafce2b
4 changed files with 7 additions and 7 deletions

View File

@ -1529,12 +1529,12 @@ void Preferences::setTransHeaderState(const QByteArray &state)
setValue("TransferList/qt5/HeaderState", state);
}
bool Preferences::getRegexAsFilteringPattern() const
bool Preferences::getRegexAsFilteringPatternForTransferList() const
{
return value("TransferList/UseRegexAsFilteringPattern", false).toBool();
}
void Preferences::setRegexAsFilteringPattern(const bool checked)
void Preferences::setRegexAsFilteringPatternForTransferList(const bool checked)
{
setValue("TransferList/UseRegexAsFilteringPattern", checked);
}

View File

@ -358,8 +358,8 @@ public:
void setTransSelFilter(const int &index);
QByteArray getTransHeaderState() const;
void setTransHeaderState(const QByteArray &state);
bool getRegexAsFilteringPattern() const;
void setRegexAsFilteringPattern(bool checked);
bool getRegexAsFilteringPatternForTransferList() const;
void setRegexAsFilteringPatternForTransferList(bool checked);
int getToolbarTextPosition() const;
void setToolbarTextPosition(const int position);

View File

@ -710,10 +710,10 @@ void MainWindow::showFilterContextMenu(const QPoint &)
menu->addSeparator();
QAction *useRegexAct = new QAction(tr("Use regular expressions"), menu);
useRegexAct->setCheckable(true);
useRegexAct->setChecked(pref->getRegexAsFilteringPattern());
useRegexAct->setChecked(pref->getRegexAsFilteringPatternForTransferList());
menu->addAction(useRegexAct);
connect(useRegexAct, &QAction::toggled, pref, &Preferences::setRegexAsFilteringPattern);
connect(useRegexAct, &QAction::toggled, pref, &Preferences::setRegexAsFilteringPatternForTransferList);
connect(useRegexAct, &QAction::toggled, this, [this]() { m_transferListWidget->applyNameFilter(m_searchFilter->text()); });
menu->exec(QCursor::pos());

View File

@ -1188,7 +1188,7 @@ void TransferListWidget::applyTrackerFilter(const QStringList &hashes)
void TransferListWidget::applyNameFilter(const QString &name)
{
const QRegExp::PatternSyntax patternSyntax = Preferences::instance()->getRegexAsFilteringPattern()
const QRegExp::PatternSyntax patternSyntax = Preferences::instance()->getRegexAsFilteringPatternForTransferList()
? QRegExp::RegExp : QRegExp::WildcardUnix;
m_sortFilterModel->setFilterRegExp(QRegExp(name, Qt::CaseInsensitive, patternSyntax));
}