From 06b73291f385fbed68f534deeb2a0c053d8e5a99 Mon Sep 17 00:00:00 2001 From: nowrep Date: Mon, 14 Nov 2011 16:00:54 +0100 Subject: [PATCH] Fixed selecting search engine when using shortcuts in locationbar It is now returning invalid engine when shortcut is empty --- src/opensearch/searchenginesmanager.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/opensearch/searchenginesmanager.cpp b/src/opensearch/searchenginesmanager.cpp index 5b9bce0df..c6d1a8d89 100644 --- a/src/opensearch/searchenginesmanager.cpp +++ b/src/opensearch/searchenginesmanager.cpp @@ -71,13 +71,18 @@ void SearchEnginesManager::loadSettings() SearchEngine SearchEnginesManager::engineForShortcut(const QString &shortcut) { + Engine returnEngine; + if (shortcut.isEmpty()) + return returnEngine; + foreach(Engine en, m_allEngines) { if (en.shortcut == shortcut) { - return en; + returnEngine = en; + break; } } - return Engine(); + return returnEngine; } QUrl SearchEnginesManager::searchUrl(const Engine &engine, const QString &string)