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


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

The following commit has been merged in the master branch:
commit 533cdb2815c68b178e9942c349f09eba8df1f281
Author: Matthias Klumpp <matthias at tenstral.net>
Date:   Thu Mar 29 22:07:19 2012 +0200

    Remove empty lines and line-breaks from KNotify chat messages
    
    Apply QString::simplified() on the chat message before
    displaying it.
    
    Reviewed-by: Martin Klapetek
---
 lib/chat-widget.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 65f5ce6..b7d68d5 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -622,13 +622,16 @@ void ChatWidget::notifyAboutIncomingMessage(const Tp::ReceivedMessage & message)
         notification->setPixmap(notificationPixmap);
     }
 
-    if (message.text().length() > 170) {
+    // Remove empty lines from message
+    QString notifyText = msg.text().simplified();
+    if (notifyText.length() > 170) {
         //search for the closest space in text
-        QString truncatedMsg = message.text().left(message.text().indexOf(QLatin1Char(' '), 150)).append(QLatin1String("..."));
+        QString truncatedMsg = notifyText.left(notifyText.indexOf(QLatin1Char(' '), 150)).append(QLatin1String("..."));
         notification->setText(truncatedMsg);
     } else {
-        notification->setText(message.text());
+        notification->setText(notifyText);
     }
+
     //allows per contact notifications
     notification->addContext(QLatin1String("contact"), message.sender()->id());
     //TODO notification->addContext("group",... Requires KDE Telepathy Contact to work out which group they are in.

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list