From 647487fcdb78d927f43be4d5f9af53ccfe7cbe15 Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 21 Jan 2012 00:20:30 +0100 Subject: [PATCH] [Fix] Fixed searching strings with & character. --- src/opensearch/searchenginesmanager.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/opensearch/searchenginesmanager.cpp b/src/opensearch/searchenginesmanager.cpp index b253b6cf0..49d72d25d 100644 --- a/src/opensearch/searchenginesmanager.cpp +++ b/src/opensearch/searchenginesmanager.cpp @@ -92,18 +92,14 @@ QUrl SearchEnginesManager::searchUrl(const Engine &engine, const QString &string { ENSURE_LOADED; - QString url = engine.url; - url.replace("%s", string); - return QUrl(url); + QByteArray url = engine.url.toUtf8(); + url.replace("%s", QUrl::toPercentEncoding(string)); + return QUrl::fromEncoded(url); } QUrl SearchEnginesManager::searchUrl(const QString &string) { - ENSURE_LOADED; - - QString url = m_activeEngine.url; - url.replace("%s", string); - return QUrl(url); + return searchUrl(m_activeEngine, string); } void SearchEnginesManager::restoreDefaults()