[SCM] ktp-approver packaging branch, master, updated. debian/15.12.1-1-299-g62cbbd7

Maximiliano Curia maxy at moszumanska.debian.org
Fri May 27 09:13:18 UTC 2016


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

The following commit has been merged in the master branch:
commit ef84a2a21edacb94c490c383a2ec934cedf0c6f7
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Mon Oct 31 14:41:33 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
---
 src/textchannelapprover.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/textchannelapprover.cpp b/src/textchannelapprover.cpp
index 3ae740f..2328910 100644
--- a/src/textchannelapprover.cpp
+++ b/src/textchannelapprover.cpp
@@ -74,7 +74,13 @@ void TextChannelApprover::onMessageReceived(const Tp::ReceivedMessage & msg)
         connect(m_notification.data(), SIGNAL(action1Activated()), SIGNAL(channelAccepted()));
     }
 
-    m_notification.data()->setText(msg.text());
+    if (msg.text().length() > 170) {
+        //search for the closest space in text
+        QString truncatedMsg = msg.text().left(msg.text().indexOf(QLatin1Char(' '), 150)).append(QLatin1String("..."));
+        m_notification.data()->setText(truncatedMsg);
+    } else {
+        m_notification.data()->setText(msg.text());
+    }
     m_notification.data()->sendEvent();
 }
 

-- 
ktp-approver packaging



More information about the pkg-kde-commits mailing list