From ff693de5bd5f54473b4a3b617143303b44380a3d Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 25 Sep 2023 07:57:42 +0200 Subject: [PATCH] do not focus google suggest popup as it prevents from more typing into location bar --- src/librssguard/network-web/googlesuggest.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/librssguard/network-web/googlesuggest.cpp b/src/librssguard/network-web/googlesuggest.cpp index 429d052e2..d10777400 100644 --- a/src/librssguard/network-web/googlesuggest.cpp +++ b/src/librssguard/network-web/googlesuggest.cpp @@ -130,7 +130,7 @@ void GoogleSuggest::showCompletion(const QStringList& choices) { m_popup->setUpdatesEnabled(true); m_popup->resize(m_editor->width(), m_popup->sizeHintForRow(0) * qMin(7, choices.count()) + 3); m_popup->move(m_editor->mapToGlobal(QPoint(0, m_editor->height()))); - m_popup->setFocus(); + // m_popup->setFocus(); m_popup->show(); } @@ -175,12 +175,14 @@ void GoogleSuggest::handleNetworkData(const QUrl& url, Q_UNUSED(http_code) if (status == QNetworkReply::NetworkError::NoError) { - QStringList choices; - QDomDocument xml; const QTextCodec* c = QTextCodec::codecForUtfText(contents); + QDomDocument xml; xml.setContent(c->toUnicode(contents)); QDomNodeList suggestions = xml.elementsByTagName(QSL("suggestion")); + QStringList choices; + + choices.reserve(suggestions.size()); for (int i = 0; i < suggestions.size(); i++) { const QDomElement element = suggestions.at(i).toElement();