From 4c83b7649ffac3d47c5cb9ce697139d34bb828eb Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 27 Feb 2013 18:14:27 +0100 Subject: Properly manage open in new tab/window selected urls --- src/webtab/webview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp index e7275db2..c6aa94e6 100644 --- a/src/webtab/webview.cpp +++ b/src/webtab/webview.cpp @@ -479,13 +479,13 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) // open selected text url in a new tab QAction * const openInNewTabAction = new KAction(KIcon("tab-new"), i18n("Open '%1' in New Tab", truncatedUrl), &menu); - openInNewTabAction->setData(QUrl(urlLikeText)); + openInNewTabAction->setData( QUrl::fromUserInput(selectedText()) ); connect(openInNewTabAction, SIGNAL(triggered(bool)), this, SLOT(openLinkInNewTab())); menu.addAction(openInNewTabAction); //open selected text url in a new window QAction * const openInNewWindowAction = new KAction(KIcon("window-new"), i18n("Open '%1' in New Window", truncatedUrl), &menu); - openInNewWindowAction->setData(QUrl(urlLikeText)); + openInNewWindowAction->setData( QUrl::fromUserInput(selectedText()) ); connect(openInNewWindowAction, SIGNAL(triggered(bool)), this, SLOT(openLinkInNewWindow())); menu.addAction(openInNewWindowAction); menu.addSeparator(); -- cgit v1.2.1