[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:06:37 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=a08d0c5
The following commit has been merged in the master branch:
commit a08d0c5759c036d35add9448e6887e3304da53fc
Author: Lasath Fernando <kde at lasath.org>
Date: Sun Mar 17 11:25:43 2013 +1100
Make UrlFilter ignore emails
It screws them up anyway because of the '>' at the end. We'll make
a separate filter for emails that deals with them better later.
BUG: 310502
---
KTp/message-url-filter.cpp | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/KTp/message-url-filter.cpp b/KTp/message-url-filter.cpp
index cb2d362..b3fd9de 100644
--- a/KTp/message-url-filter.cpp
+++ b/KTp/message-url-filter.cpp
@@ -41,14 +41,16 @@ void MessageUrlFilter::filterMessage(KTp::Message &info, const KTp::MessageConte
int offset = 0;
for (int i = 0; i < parsedUrl.fixedUrls.size(); i++) {
KUrl url(parsedUrl.fixedUrls.at(i));
- QString originalText = message.mid(parsedUrl.urlRanges.at(i).first + offset, parsedUrl.urlRanges.at(i).second);
- QString link = QString::fromLatin1("<a href=\"%1\">%2</a>").arg(QString::fromAscii(url.toEncoded()), originalText);
- message.replace(parsedUrl.urlRanges.at(i).first + offset, parsedUrl.urlRanges.at(i).second, link);
+ if (url.protocol() != QLatin1String("mailto")) {
+ QString originalText = message.mid(parsedUrl.urlRanges.at(i).first + offset, parsedUrl.urlRanges.at(i).second);
+ QString link = QString::fromLatin1("<a href=\"%1\">%2</a>").arg(QString::fromAscii(url.toEncoded()), originalText);
+ message.replace(parsedUrl.urlRanges.at(i).first + offset, parsedUrl.urlRanges.at(i).second, link);
- urls.append(url);
+ urls.append(url);
- //after the first replacement is made, the original position values are not valid anymore, this adjusts them
- offset += link.length() - originalText.length();
+ //after the first replacement is made, the original position values are not valid anymore, this adjusts them
+ offset += link.length() - originalText.length();
+ }
}
info.setProperty("Urls", urls);
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list