mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-19 18:26:34 +01:00
Searchbar: Fix show suggestions handling
Do not contact search engine when suggestions are disabled. BUG: 439268 Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
bdfeff5b08
commit
f5350dbe41
@ -156,6 +156,7 @@ void WebSearchBar::enableSearchSuggestions(bool enable)
|
||||
|
||||
qzSettings->showWSBSearchSuggestions = enable;
|
||||
m_completerModel->setStringList(QStringList());
|
||||
updateOpenSearchEngine();
|
||||
}
|
||||
|
||||
void WebSearchBar::setupEngines()
|
||||
@ -200,8 +201,7 @@ void WebSearchBar::searchChanged(const ButtonWithMenu::Item &item)
|
||||
|
||||
m_activeEngine = item.userData.value<SearchEngine>();
|
||||
|
||||
m_openSearchEngine->setSuggestionsUrl(m_activeEngine.suggestionsUrl);
|
||||
m_openSearchEngine->setSuggestionsParameters(m_activeEngine.suggestionsParameters);
|
||||
updateOpenSearchEngine();
|
||||
|
||||
m_searchManager->setActiveEngine(m_activeEngine);
|
||||
|
||||
@ -334,3 +334,14 @@ void WebSearchBar::keyPressEvent(QKeyEvent* event)
|
||||
|
||||
LineEdit::keyPressEvent(event);
|
||||
}
|
||||
|
||||
void WebSearchBar::updateOpenSearchEngine()
|
||||
{
|
||||
if (qzSettings->showWSBSearchSuggestions) {
|
||||
m_openSearchEngine->setSuggestionsUrl(m_activeEngine.suggestionsUrl);
|
||||
m_openSearchEngine->setSuggestionsParameters(m_activeEngine.suggestionsParameters);
|
||||
}
|
||||
else {
|
||||
m_openSearchEngine->setSuggestionsUrl(QL1S(""));
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,8 @@ private:
|
||||
|
||||
void contextMenuEvent(QContextMenuEvent* event) override;
|
||||
|
||||
void updateOpenSearchEngine();
|
||||
|
||||
QCompleter* m_completer;
|
||||
QStringListModel* m_completerModel;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user