summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-09-30 15:59:47 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-09-30 15:59:47 +0200
commit49a892039ee00e5497903a5380d733031423f7a1 (patch)
treebf2d0b7b68c6fee47d6ae48ed2fba4d170312acc
parentModified the strings a bit, to let them contain %1 etc. (diff)
parentMade the String "easier" to translatable, by (diff)
downloadrekonq-49a892039ee00e5497903a5380d733031423f7a1.tar.xz
Merge commit 'refs/merge-requests/1654' of git://gitorious.org/rekonq/mainline into PanoCode
-rw-r--r--src/webview.cpp13
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);