diff options
author | Panagiotis Papadopoulos <pano_90@gmx.net> | 2009-09-30 14:47:28 +0200 |
---|---|---|
committer | Panagiotis Papadopoulos <pano_90@gmx.net> | 2009-09-30 14:47:28 +0200 |
commit | afca7533c88b062a549363786abdac30d92d7d18 (patch) | |
tree | 681154bf3e3c1b47fafa5ead53720baffa9926ef /src | |
parent | "Added support" for opening URLs that start with www. (diff) | |
download | rekonq-afca7533c88b062a549363786abdac30d92d7d18.tar.xz |
Made the String "easier" to translatable, by
changing some stuff.
Thanks to Lionel and
http://websvn.kde.org/trunk/playground/libs/webkitkde/part/webview.cpp?revision=993719&view=markup
(lines 186-188)
;-)
Diffstat (limited to 'src')
-rw-r--r-- | src/webview.cpp | 11 |
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); |