[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:18:16 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=07c4d17

The following commit has been merged in the master branch:
commit 07c4d17efb852f8cac9944a8269d6257ad66bc03
Author: Aleix Pol <aleixpol at kde.org>
Date:   Thu Feb 21 13:56:38 2013 +0100

    Figure out the chat plasmoid state
    
    Tell the plasmoid state given the open conversations and the unread
    messages.
    
    REVIEW: 109072
    CCBUG: 296928
---
 chat/org.kde.ktp-chat/contents/ui/main.qml | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/chat/org.kde.ktp-chat/contents/ui/main.qml b/chat/org.kde.ktp-chat/contents/ui/main.qml
index 19d7a5c..3a9b74d 100644
--- a/chat/org.kde.ktp-chat/contents/ui/main.qml
+++ b/chat/org.kde.ktp-chat/contents/ui/main.qml
@@ -41,6 +41,21 @@ Grid {
     TelepathyTextObserver { id: handler }
     HideWindowComponent { id: windowHide }
 
+    function reconsiderStatus() {
+        if(handler.conversations.totalUnreadCount>0) {
+            plasmoid.state = NeedsAttentionStatus;
+        } else if(conversationsView.count>0) {
+            plasmoid.state = ActiveStatus;
+        } else {
+            plasmoid.state = PassiveStatus;
+        }
+    }
+
+    Connections {
+        target: handler.conversations
+        onTotalUnreadCountChanged: reconsiderStatus()
+    }
+
     Component.onCompleted: {
         plasmoid.aspectRatioMode = plasmoid.IgnoreAspectRatio
         plasmoid.addEventListener('activate', function() {
@@ -81,11 +96,13 @@ Grid {
     }
 
     Repeater {
+        id: conversationsView
         delegate: ConversationDelegate {
             width: base.itemSize
             height: width
             popupBelow: base.flow === Flow.LeftToRight
         }
         model: handler.conversations
+        onCountChanged: reconsiderStatus()
     }
 }

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list