Browse Source

searchengine: don't use strings to determine the status of search processes

'&' symbols are dynamically added to strings, making comparisons
unreliable.
adaptive-webui-19844
Gabriele 9 years ago
parent
commit
0f35bac605
  1. 5
      src/searchengine/searchengine.cpp
  2. 1
      src/searchengine/searchengine.h

5
src/searchengine/searchengine.cpp

@ -184,6 +184,7 @@ void SearchEngine::searchTextEdited(QString) @@ -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() @@ -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());

1
src/searchengine/searchengine.h

@ -126,6 +126,7 @@ private: @@ -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…
Cancel
Save