From 400eafce2b392a4eb543ebc008ba320623fbdb2f Mon Sep 17 00:00:00 2001 From: thalieht Date: Sun, 12 Aug 2018 17:46:16 +0300 Subject: [PATCH] Rename 2 methods to eliminate ambiguity --- src/base/preferences.cpp | 4 ++-- src/base/preferences.h | 4 ++-- src/gui/mainwindow.cpp | 4 ++-- src/gui/transferlistwidget.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/base/preferences.cpp b/src/base/preferences.cpp index 39fd386ee..79617c6bd 100644 --- a/src/base/preferences.cpp +++ b/src/base/preferences.cpp @@ -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); } diff --git a/src/base/preferences.h b/src/base/preferences.h index b49765fc7..466305bb2 100644 --- a/src/base/preferences.h +++ b/src/base/preferences.h @@ -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); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 7bb893e2a..a77be0461 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -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()); diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index 94fa159f4..99ca87d61 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -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)); }