diff options
Diffstat (limited to 'src/urlbar')
-rw-r--r-- | src/urlbar/listitem.cpp | 7 | ||||
-rw-r--r-- | src/urlbar/urlbar.cpp | 2 | ||||
-rw-r--r-- | src/urlbar/urlsuggester.cpp | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp index cc0bf253..580eea53 100644 --- a/src/urlbar/listitem.cpp +++ b/src/urlbar/listitem.cpp @@ -460,7 +460,12 @@ void SearchListItem::changeSearchEngine(KService::Ptr engine) // NOTE: This to let rekonq loading text typed in the requested engine on click. // There probably is a better way to do it. I just cannot see it now... - QString text = m_text; + // remove the xx: part... + QString separator = SearchEngine::delimiter(); + + QString text = m_text.contains(separator) + ? m_text.section(separator, 1, 1) + : m_text; // create a new item && load it... UrlSuggestionItem item = UrlSuggestionItem(UrlSuggestionItem::Search, SearchEngine::buildQuery(engine, text), text); diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index c0277c20..6af68a3d 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -665,7 +665,7 @@ void UrlBar::pasteAndSearch() { KService::Ptr defaultEngine = SearchEngine::defaultEngine(); if (defaultEngine) - loadRequestedUrl(KUrl(SearchEngine::buildQuery(QApplication::clipboard()->text().trimmed()))); + loadRequestedUrl(KUrl(SearchEngine::buildQuery(defaultEngine, QApplication::clipboard()->text().trimmed()))); } diff --git a/src/urlbar/urlsuggester.cpp b/src/urlbar/urlsuggester.cpp index 9ca4e8f8..d6aaaf52 100644 --- a/src/urlbar/urlsuggester.cpp +++ b/src/urlbar/urlsuggester.cpp @@ -321,6 +321,7 @@ void UrlSuggester::computeWebSearches() KService::Ptr engine = SearchEngine::fromString(_typedString); if (engine) { + query = query.remove(0, _typedString.indexOf(SearchEngine::delimiter()) + 1); _isKDEShortUrl = true; } else @@ -330,7 +331,7 @@ void UrlSuggester::computeWebSearches() if (engine) { - UrlSuggestionItem item = UrlSuggestionItem(UrlSuggestionItem::Search, SearchEngine::buildQuery(query), query, engine->name()); + UrlSuggestionItem item = UrlSuggestionItem(UrlSuggestionItem::Search, SearchEngine::buildQuery(engine, query), query, engine->name()); UrlSuggestionList list; list << item; _webSearches = list; |