diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-09-30 15:59:47 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-09-30 15:59:47 +0200 |
commit | 49a892039ee00e5497903a5380d733031423f7a1 (patch) | |
tree | bf2d0b7b68c6fee47d6ae48ed2fba4d170312acc | |
parent | Modified the strings a bit, to let them contain %1 etc. (diff) | |
parent | Made the String "easier" to translatable, by (diff) | |
download | rekonq-49a892039ee00e5497903a5380d733031423f7a1.tar.xz |
Merge commit 'refs/merge-requests/1654' of git://gitorious.org/rekonq/mainline into PanoCode
-rw-r--r-- | src/webview.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index fac98f71..0f92cff4 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -215,16 +215,23 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) { // page action QString text = selectedText(); - if (text.startsWith( QLatin1String("http://") ) || text.startsWith( QLatin1String("https://") )) + 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); |