mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 13:18:06 -06:00
Avoid creating unnecessary event loops
The `exec()` method will create another event loop and transfer control over there which might introduce unexpected bugs.
This commit is contained in:
@@ -358,7 +358,9 @@ void SearchJobWidget::showFilterContextMenu(const QPoint &)
|
||||
const Preferences *pref = Preferences::instance();
|
||||
|
||||
QMenu *menu = m_lineEditSearchResultsFilter->createStandardContextMenu();
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
menu->addSeparator();
|
||||
|
||||
QAction *useRegexAct = new QAction(tr("Use regular expressions"), menu);
|
||||
useRegexAct->setCheckable(true);
|
||||
useRegexAct->setChecked(pref->getRegexAsFilteringPatternForSearchJob());
|
||||
@@ -367,7 +369,7 @@ void SearchJobWidget::showFilterContextMenu(const QPoint &)
|
||||
connect(useRegexAct, &QAction::toggled, pref, &Preferences::setRegexAsFilteringPatternForSearchJob);
|
||||
connect(useRegexAct, &QAction::toggled, this, [this]() { filterSearchResults(m_lineEditSearchResultsFilter->text()); });
|
||||
|
||||
menu->exec(QCursor::pos());
|
||||
menu->popup(QCursor::pos());
|
||||
}
|
||||
|
||||
QString SearchJobWidget::statusText(SearchJobWidget::Status st)
|
||||
|
||||
Reference in New Issue
Block a user