summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/webview.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index d416af49..f31d2343 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -229,6 +229,18 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
// is content selected? Add SEARCH actions
if (result.isContentSelected())
{
+ //Default SearchEngine
+ KService::Ptr defaultEngine = SearchEngine::defaultEngine();
+ if (defaultEngine) // check if a default engine is set
+ {
+ a = new KAction(i18nc("Search selected text with the default search engine", "Search with %1", defaultEngine->name()), this);
+ a->setIcon(rApp->iconManager()->iconForUrl(SearchEngine::buildQuery(defaultEngine, "")));
+ a->setData(defaultEngine->entryPath());
+ connect(a, SIGNAL(triggered(bool)), this, SLOT(search()));
+ menu.addAction(a);
+ }
+
+ //All favourite ones
KActionMenu *searchMenu = new KActionMenu(KIcon("edit-find"), i18n("Search with"), this);
foreach(const KService::Ptr & engine, SearchEngine::favorites())