summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 0f646278..e4d98298 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -214,17 +214,18 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
if(result.linkUrl().isEmpty())
{
// page action
- if (selectedText().startsWith("http://") || selectedText().startsWith("https://"))
+ QString text = selectedText();
+ if (text.startsWith( QLatin1String("http://") ) || text.startsWith( QLatin1String("https://") ))
{
//open selected text url in a new tab
- a = new KAction(KIcon("tab-new"), i18n("Open: '") + selectedText().toUtf8().left(15) + QString("...'"), this);
- a->setData(QUrl(selectedText()));
+ a = new KAction(KIcon("tab-new"), i18n("Open: '") + text.toUtf8().left(15) + QString("...'"), this);
+ a->setData(QUrl(text));
connect(a, SIGNAL(triggered(bool)), this, SLOT(openLinkInNewTab()));
menu.addAction(a);
//open selected text url in a new window
- a = new KAction(KIcon("window-new"), i18n("Open: '") + selectedText().toUtf8().left(15) + QString("...'"), this);
- a->setData(QUrl(selectedText()));
+ a = new KAction(KIcon("window-new"), i18n("Open: '") + text.toUtf8().left(15) + QString("...'"), this);
+ a->setData(QUrl(text));
connect(a, SIGNAL(triggered(bool)), this, SLOT(openLinkInNewWindow()));
menu.addAction(a);
}