mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-06 15:04:34 +08: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
1b24feb4f4
commit
0f35bac605
@ -184,6 +184,7 @@ void SearchEngine::searchTextEdited(QString)
|
||||
{
|
||||
// Enable search button
|
||||
search_button->setText(tr("Search"));
|
||||
newQueryString = true;
|
||||
}
|
||||
|
||||
void SearchEngine::giveFocusToSearchInput()
|
||||
@ -211,12 +212,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
|
||||
|
Loading…
Reference in New Issue
Block a user