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


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

The following commit has been merged in the master branch:
commit daee4a2c98a50a32c2a16346700aa105a6c2af4a
Author: Peter Amidon <peter at picnicpark.org>
Date:   Fri Nov 30 17:13:33 2012 +0100

    Added plasma-themeability to the presence applet.
    
    The presence applet is now plasma-themeable: if a file
    icons/presence-applet.{svg,svgz} exists, and it has the correct icon
    in it (user-<state>-plasma, like user-offline-plasma), then it will
    use that SVG icon instead of the default.
    
    Reviewed-by: Martin Klapetek
    BUG: 302993
---
 presence/src/presence-applet.cpp | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/presence/src/presence-applet.cpp b/presence/src/presence-applet.cpp
index 7cb2790..35f233d 100644
--- a/presence/src/presence-applet.cpp
+++ b/presence/src/presence-applet.cpp
@@ -37,6 +37,7 @@
 #include <KTp/Widgets/join-chat-room-dialog.h>
 
 #include <Plasma/ToolTipManager>
+#include <Plasma/Svg>
 
 #include <TelepathyQt/PendingOperation>
 #include <TelepathyQt/PendingContacts>
@@ -62,7 +63,7 @@ TelepathyPresenceApplet::TelepathyPresenceApplet(QObject *parent, const QVariant
 
     m_icon = new Plasma::IconWidget(this);
     connect(m_icon, SIGNAL(clicked()), this, SLOT(startContactList()));
-    m_icon->setIcon(m_globalPresence->currentPresence().icon());
+    onPresenceChanged(m_globalPresence->currentPresence());
 
     QGraphicsLinearLayout *layout = new QGraphicsLinearLayout();
     layout->setContentsMargins(2, 2, 2, 2);
@@ -266,7 +267,18 @@ void TelepathyPresenceApplet::onMakeCallRequest()
 
 void TelepathyPresenceApplet::onPresenceChanged(KTp::Presence presence)
 {
-    m_icon->setIcon(presence.icon());
+    QString iconBaseName = presence.iconName(false);
+
+    Plasma::Svg svgIcon;
+    svgIcon.setImagePath("icons/presence-applet");
+    if (svgIcon.hasElement(iconBaseName+"-plasma")) {
+        svgIcon.resize(150,150);
+        KIcon icon = KIcon(svgIcon.pixmap(iconBaseName+"-plasma"));
+        m_icon->setIcon(icon);
+    } else {
+        m_icon->setIcon(presence.icon());
+    }
+ }
 }
 
 void TelepathyPresenceApplet::onPresenceActionClicked()

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list