summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2012-12-03 09:25:30 +0100
committerMontel Laurent <montel@kde.org>2012-12-03 09:26:04 +0100
commit730ba60a9436c95113d168bf463589a241b2f174 (patch)
treedfa0ea0b0986b7d5d097ed126dcaab7293c8d573
parentSVN_SILENT made messages (.desktop file) (diff)
downloadrekonq-730ba60a9436c95113d168bf463589a241b2f174.tar.xz
Don't create menu/action when not necessary
-rw-r--r--src/webview.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 36908017..48273fb5 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -253,8 +253,14 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
m_ContextMenuResult = page()->mainFrame()->hitTestContent(event->pos());
MainWindow *mainwindow = rApp->mainWindow();
+ if (m_ContextMenuResult.isContentEditable())
+ {
+ // Check to see if handled by speller
+ if (popupSpellMenu(event))
+ return;
+ }
+
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()));
@@ -282,14 +288,11 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
// is content editable? Add PASTE
if (m_ContextMenuResult.isContentEditable())
{
- // Check to see if handled by speller
- if (popupSpellMenu(event))
- return;
-
menu.addAction(pageAction(KWebPage::Paste));
menu.addSeparator();
}
+ QAction *a;
// EMPTY PAGE ACTIONS -------------------------------------------------------------
if (resultHit == WebView::EmptySelection)
{