mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
searchengine: don't use strings to determine the status of search processes
'&' symbols are dynamically added to strings, making comparisons unreliable.
This commit is contained in:
parent
778046439c
commit
4420ae1996
2 changed files with 5 additions and 1 deletions
|
@ -183,6 +183,7 @@ void SearchEngine::searchTextEdited(QString)
|
||||||
{
|
{
|
||||||
// Enable search button
|
// Enable search button
|
||||||
search_button->setText(tr("Search"));
|
search_button->setText(tr("Search"));
|
||||||
|
newQueryString = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchEngine::giveFocusToSearchInput()
|
void SearchEngine::giveFocusToSearchInput()
|
||||||
|
@ -210,12 +211,14 @@ void SearchEngine::on_search_button_clicked()
|
||||||
|
|
||||||
searchProcess->waitForFinished(1000);
|
searchProcess->waitForFinished(1000);
|
||||||
|
|
||||||
if (search_button->text() != tr("Search")) {
|
if (!newQueryString) {
|
||||||
search_button->setText(tr("Search"));
|
search_button->setText(tr("Search"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newQueryString = false;
|
||||||
|
|
||||||
// Reload environment variables (proxy)
|
// Reload environment variables (proxy)
|
||||||
searchProcess->setEnvironment(QProcess::systemEnvironment());
|
searchProcess->setEnvironment(QProcess::systemEnvironment());
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,7 @@ private:
|
||||||
QList<QPointer<SearchTab> > all_tab; // To store all tabs
|
QList<QPointer<SearchTab> > all_tab; // To store all tabs
|
||||||
const SearchCategories full_cat_names;
|
const SearchCategories full_cat_names;
|
||||||
MainWindow *mp_mainWindow;
|
MainWindow *mp_mainWindow;
|
||||||
|
bool newQueryString;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue