[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:21:04 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=a14ff05

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

    Re-add HTML escaping of original message
---
 lib/adium-theme-message-info.cpp |  7 -------
 lib/message.cpp                  | 15 +++++++++++----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib/adium-theme-message-info.cpp b/lib/adium-theme-message-info.cpp
index 0c65268..e9aa300 100644
--- a/lib/adium-theme-message-info.cpp
+++ b/lib/adium-theme-message-info.cpp
@@ -71,13 +71,6 @@ AdiumThemeMessageInfo::MessageType AdiumThemeMessageInfo::type() const
 
 QString AdiumThemeMessageInfo::message() const
 {
-//     QString htmlMessage= Qt::escape(d->message);
-//     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.
-
     return d->message;
 }
 
diff --git a/lib/message.cpp b/lib/message.cpp
index a227cba..163ed7c 100644
--- a/lib/message.cpp
+++ b/lib/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-text-ui packaging



More information about the pkg-kde-commits mailing list