mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06: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:
committed by
sledgehammer999
parent
778046439c
commit
4420ae1996
@@ -183,6 +183,7 @@ void SearchEngine::searchTextEdited(QString)
|
||||
{
|
||||
// Enable search button
|
||||
search_button->setText(tr("Search"));
|
||||
newQueryString = true;
|
||||
}
|
||||
|
||||
void SearchEngine::giveFocusToSearchInput()
|
||||
@@ -210,12 +211,14 @@ void SearchEngine::on_search_button_clicked()
|
||||
|
||||
searchProcess->waitForFinished(1000);
|
||||
|
||||
if (search_button->text() != tr("Search")) {
|
||||
if (!newQueryString) {
|
||||
search_button->setText(tr("Search"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
newQueryString = false;
|
||||
|
||||
// Reload environment variables (proxy)
|
||||
searchProcess->setEnvironment(QProcess::systemEnvironment());
|
||||
|
||||
|
||||
@@ -126,6 +126,7 @@ private:
|
||||
QList<QPointer<SearchTab> > all_tab; // To store all tabs
|
||||
const SearchCategories full_cat_names;
|
||||
MainWindow *mp_mainWindow;
|
||||
bool newQueryString;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user