summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Tröscher <fritz_van_tom@hotmail.com>2011-08-02 19:49:15 +0200
committerJohannes Tröscher <fritz_van_tom@hotmail.com>2011-08-02 19:49:15 +0200
commit961e1472e3b81046dec8fb61c9bd95589230890f (patch)
treee505b85f5162d99c4792104efb89dcd650c30c46
parentdetect srollbar extent in notifyMessage REVIEW:102182 (diff)
downloadrekonq-961e1472e3b81046dec8fb61c9bd95589230890f.tar.xz
action to search with default searchEnine in marked text's context menu. REVIEW:102180
-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())