From 66edb6d66102e2ae7c0fd234f932b515fe101635 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 28 Nov 2012 22:47:42 +0100 Subject: Restoring inspector, part 1 restored action and code to activate/deactivate it --- src/webtab/webview.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/webtab/webview.cpp') diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp index 0cc09574..ec74be1e 100644 --- a/src/webtab/webview.cpp +++ b/src/webtab/webview.cpp @@ -274,9 +274,6 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) KMenu menu(this); QAction *a; - KAction *inspectAction = new KAction(KIcon("layer-visible-on"), i18n("Inspect Element"), this); - connect(inspectAction, SIGNAL(triggered(bool)), this, SLOT(inspect())); - KAction *sendByMailAction = new KAction(this); sendByMailAction->setIcon(KIcon("mail-send")); connect(sendByMailAction, SIGNAL(triggered(bool)), this, SLOT(sendByMail())); @@ -359,7 +356,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) if (webwin) { menu.addAction(webwin->actionByName("page_source")); - menu.addAction(inspectAction); + menu.addAction(webwin->actionByName("web_inspector")); } } @@ -542,7 +539,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) menu.addAction(sendByMailAction); if (webwin) - menu.addAction(inspectAction); + menu.addAction(webwin->actionByName("web_inspector")); // SPELL CHECK Actions if (m_contextMenuHitResult.isContentEditable()) @@ -1045,17 +1042,6 @@ void WebView::wheelEvent(QWheelEvent *event) } -void WebView::inspect() -{ - WebTab *tab = qobject_cast(parent()); - WebWindow *webwin = tab->webWindow(); - QAction *a = webwin->actionByName("web_inspector"); - if (a && !a->isChecked()) - a->trigger(); - pageAction(QWebPage::InspectElement)->trigger(); -} - - void WebView::scrollFrameChanged() { // do the scrolling -- cgit v1.2.1