summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/webview.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 45967430..0f92cff4 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -217,14 +217,21 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
QString text = selectedText();
if (text.startsWith( QLatin1String("http://") ) || text.startsWith( QLatin1String("https://") ) || text.startsWith( QLatin1String("www.") ) )
{
+ QString truncatedURL = text;
+ if (text.length() > 18)
+ {
+ truncatedURL.truncate(15);
+ truncatedURL += "...";
+ }
+
//open selected text url in a new tab
- a = new KAction(KIcon("tab-new"), i18n("Open: '") + text.toUtf8().left(15) + QString("...'"), this);
+ a = new KAction(KIcon("tab-new"), i18n("Open '%1' in New Tab", truncatedURL), 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: '") + text.toUtf8().left(15) + QString("...'"), this);
+ a = new KAction(KIcon("window-new"), i18n("Open '%1' in New Window", truncatedURL), this);
a->setData(QUrl(text));
connect(a, SIGNAL(triggered(bool)), this, SLOT(openLinkInNewWindow()));
menu.addAction(a);