From cf501ead612195b14b42a5351085e36a4d56a6f9 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 14 May 2009 10:11:26 +0200 Subject: Fixed unusual cut/copy/paste actions on top of menu --- src/webview.cpp | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/webview.cpp b/src/webview.cpp index 055f2f7d..ddfd986f 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -375,9 +375,27 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) addBookmarkAction->setData(QVariant()); KMenu menu(this); + // link actions + bool linkIsEmpty = result.linkUrl().isEmpty(); + if (!linkIsEmpty) + { + menu.addAction(webActions()->action("open_link_in_new_tab")); + } + else + { + menu.addAction(mainwindow->actionByName("new_tab")); + } + menu.addAction(mainwindow->actionByName("view_redisplay")); + menu.addSeparator(); + + // Developer Extras actions + if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled)) + { + menu.addAction(webActions()->action("inspect_element")); + menu.addSeparator(); + } // cut - copy - paste Actions. - // If someone selects text perhaps wanna work with it.. bool b = false; if (result.isContentSelected() && result.isContentEditable()) @@ -403,26 +421,6 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) menu.addSeparator(); } - // link actions - bool linkIsEmpty = result.linkUrl().isEmpty(); - if (!linkIsEmpty) - { - menu.addAction(webActions()->action("open_link_in_new_tab")); - } - else - { - menu.addAction(mainwindow->actionByName("new_tab")); - } - menu.addAction(mainwindow->actionByName("view_redisplay")); - menu.addSeparator(); - - // Developer Extras actions - if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled)) - { - menu.addAction(webActions()->action("inspect_element")); - menu.addSeparator(); - } - // save/copy link actions if (!linkIsEmpty) { -- cgit v1.2.1