diff options
author | Montel Laurent <montel@kde.org> | 2012-12-04 16:51:54 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:06 +0100 |
commit | c68e19b301824d3a8afa97c690e75c8578c76818 (patch) | |
tree | a7452fd634b3746544ce2f930ad7134e1d916940 | |
parent | rekonq 1.81 (diff) | |
download | rekonq-c68e19b301824d3a8afa97c690e75c8578c76818.tar.xz |
Don't create menu/action when not necessary
-rw-r--r-- | src/webtab/webview.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp index 862355e9..b48c57fe 100644 --- a/src/webtab/webview.cpp +++ b/src/webtab/webview.cpp @@ -268,10 +268,16 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) { m_contextMenuHitResult = page()->mainFrame()->hitTestContent(event->pos()); + if (m_contextMenuHitResult.isContentEditable()) + { + // Check to see if handled by speller + if (popupSpellMenu(event)) + return; + } + WebWindow *webwin = m_parentTab->webWindow(); KMenu menu(this); - QAction *a; KAction *sendByMailAction = new KAction(this); sendByMailAction->setIcon(KIcon("mail-send")); @@ -296,14 +302,12 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) // is content editable? Add PASTE if (m_contextMenuHitResult.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) { |