summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-07-11 17:28:20 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-07-11 17:30:05 +0200
commitf5424d18c2050023f62dd92e97f882056c09e00f (patch)
tree619356ce2626d4b8f5c442bcec1f4e2a6e31df3c /src/webview.cpp
parentFull url selection on double click. (diff)
downloadrekonq-f5424d18c2050023f62dd92e97f882056c09e00f.tar.xz
syntax fix and addBookmark Action created just if necessary
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index ce7378de..2273dcb5 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -125,10 +125,6 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
QWebHitTestResult result = page()->mainFrame()->hitTestContent(event->pos());
MainWindow *mainwindow = Application::instance()->mainWindow();
- QAction *addBookmarkAction = Application::bookmarkProvider()->actionByName("add_bookmark_payload");
- addBookmarkAction->setText(i18n("Bookmark This Page"));
- addBookmarkAction->setData(QVariant());
-
KMenu menu(this);
// link actions
@@ -203,6 +199,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
if (!linkIsEmpty)
{
menu.addSeparator();
+ QAction *addBookmarkAction = Application::bookmarkProvider()->actionByName("add_bookmark_payload");
addBookmarkAction->setData(result.linkUrl());
addBookmarkAction->setText(i18n("&Bookmark This Link"));
menu.addAction(addBookmarkAction);
@@ -252,9 +249,11 @@ void WebView::keyPressEvent(QKeyEvent *event)
QWebView::keyPressEvent(event);
}
+
void WebView::mousePressEvent(QMouseEvent *event)
{
- switch(event->button()) {
+ switch(event->button())
+ {
case Qt::XButton1:
triggerPageAction(QWebPage::Back);
break;