[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:04:57 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=921c79d

The following commit has been merged in the master branch:
commit 921c79d08d2174a995a4a8051564ced041b83210
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Wed Feb 1 23:09:29 2012 +0000

    Re-add HTML escaping of original message
---
 KTp/message.cpp | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/KTp/message.cpp b/KTp/message.cpp
index a227cba..163ed7c 100644
--- a/KTp/message.cpp
+++ b/KTp/message.cpp
@@ -23,14 +23,21 @@
 using namespace KTp;
 
 Message::Message(Tp::Message &original)
-    : originalMessage(original),
-      content(originalMessage.text())
+    : originalMessage(original)
 {
+    QString htmlMessage= Qt::escape(originalMessage.text());
+    htmlMessage.replace(QLatin1String("
 "), QLatin1String("<br/> ")); //keep leading whitespaces
+    htmlMessage.replace(QLatin1Char('
'), QLatin1String("<br/>"));
+    htmlMessage.replace(QLatin1Char('	'), QLatin1String("    ")); // replace tabs by 4 spaces
+    htmlMessage.replace(QLatin1String("  "), QLatin1String("  ")); // keep multiple whitespaces
+    htmlMessage.replace(QLatin1Char('\'), QLatin1String("\\")); //replace a single backslash with two backslashes.
+
+    setMainMessagePart(htmlMessage);
 }
 
 QString Message::mainMessagePart() const
 {
-    return content.operator[](Message::MainMessage);
+    return content[Message::MainMessage];
 }
 
 void Message::setMainMessagePart(const QString& message)
@@ -53,4 +60,4 @@ QString Message::finalizedMessage() const
 QVariantMap& Message::miscData()
 {
     return m_miscData;
-}
\ No newline at end of file
+}

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list