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


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

The following commit has been merged in the master branch:
commit 3ef1a3f7a7e87ba8a256d7d01227eec7df1636c0
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Mon Oct 31 14:39:19 2011 +0100

    Truncate long messages in the notification popup, so they don't fill up the whole screen with one plasma popup.
    
    Reviewed-by: David Edmundson
---
 lib/chat-widget.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index ea673b0..059cba6 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -598,7 +598,13 @@ void ChatWidget::notifyAboutIncomingMessage(const Tp::ReceivedMessage & message)
         notification->setPixmap(notificationPixmap);
     }
 
-    notification->setText(message.text());
+    if (message.text().length() > 170) {
+        //search for the closest space in text
+        QString truncatedMsg = message.text().left(message.text().indexOf(QLatin1Char(' '), 150)).append(QLatin1String("..."));
+        notification->setText(truncatedMsg);
+    } else {
+        notification->setText(message.text());
+    }
     //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