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


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

The following commit has been merged in the master branch:
commit 9744b7d06eb592dc6c32c2eb41903967b7fcd092
Author: Aleix Pol <aleixpol at kde.org>
Date:   Mon Apr 14 00:07:58 2014 +0200

    Make it possible to set the current presence
---
 .../org.kde.ktp-contactlist/contents/ui/main.qml     | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/contactlist/org.kde.ktp-contactlist/contents/ui/main.qml b/contactlist/org.kde.ktp-contactlist/contents/ui/main.qml
index b7527bb..bcd4cad 100644
--- a/contactlist/org.kde.ktp-contactlist/contents/ui/main.qml
+++ b/contactlist/org.kde.ktp-contactlist/contents/ui/main.qml
@@ -34,13 +34,33 @@ Item
         source: ktpPresence.currentPresenceIcon
     }
 
+    KTp.PresenceModel {
+        id: presenceModel
+    }
 
     KTp.GlobalPresence {
         id: ktpPresence
         accountManager: telepathyManager.accountManager
     }
+
+    function setPresence(row) {
+        ktpPresence.requestedPresence = presenceModel.get(row, "presence");
+    }
+
     Component.onCompleted: {
         telepathyManager.addContactListFeatures();
         telepathyManager.becomeReady();
+
+        //TODO: The PresenceModel might change, this will never react to such changes
+        for(var i=0; i<presenceModel.count; ++i) {
+            var disp = presenceModel.get(i, "display");
+            var actionName = "setStatus"+disp;
+            plasmoid.setAction(actionName, disp, presenceModel.get(i, "iconName"));
+
+            //NOTE: This is done like this only because we don't know better
+            var f = eval("function() { root.setPresence("+i+"); }");
+            plasmoid.action(actionName).triggered.connect(f);
+        }
+        plasmoid.setActionSeparator("statuses");
     }
 }

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list