Browse Source

Rename 2 methods to eliminate ambiguity

adaptive-webui-19844
thalieht 6 years ago
parent
commit
400eafce2b
  1. 4
      src/base/preferences.cpp
  2. 4
      src/base/preferences.h
  3. 4
      src/gui/mainwindow.cpp
  4. 2
      src/gui/transferlistwidget.cpp

4
src/base/preferences.cpp

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

4
src/base/preferences.h

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

4
src/gui/mainwindow.cpp

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

2
src/gui/transferlistwidget.cpp

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

Loading…
Cancel
Save