[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:12:04 UTC 2016


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

The following commit has been merged in the master branch:
commit c700b23c854d6da6f6957fdbc2328e499ab7ef5b
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date:   Sun Dec 11 19:28:54 2011 +0100

    Plasmoid is installable and base for QML has been layed out
---
 presence/src/presence-applet.cpp | 20 ++++++++++++++++++--
 presence/src/presence-applet.h   |  7 +++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/presence/src/presence-applet.cpp b/presence/src/presence-applet.cpp
index 5f61f0f..5b36412 100644
--- a/presence/src/presence-applet.cpp
+++ b/presence/src/presence-applet.cpp
@@ -44,22 +44,36 @@ TelepathyPresenceApplet::~TelepathyPresenceApplet()
 //     m_qmlObject ??
 }
 
+int TelepathyPresenceApplet::appletHeight() const
+{
+    return geometry().height();
+}
+
+int TelepathyPresenceApplet::appletWidth() const
+{
+    return geometry().width();
+}
+
 void TelepathyPresenceApplet::init()
 {
     Plasma::Applet::init();
 
     if (m_declarative) {
         /// TODO sort this path out with correct one
-        QString qmlFile = KGlobal::dirs()->findResource("data", "plasma/plasmoids/org.kde.telepathy-contact/contents/ui/main.qml");
+        QString qmlFile = KGlobal::dirs()->findResource("data", "plasma/plasmoids/org.kde.telepathy-kde-presence-applet/contents/ui/main.qml");
         qDebug() << "LOADING: " << qmlFile;
         m_declarative->setQmlPath(qmlFile);
-        m_declarative->engine()->rootContext()->setContextProperty("GlobalPresence", m_globalPresenceWrapper);
+        m_declarative->engine()->rootContext()->setContextProperty("TelepathyPresenceApplet", m_globalPresenceWrapper);
 
         // setup qml object so that we can talk to the declarative part
         m_qmlObject = dynamic_cast<QObject*>(m_declarative->rootObject());
 
         // connect the qml object to recieve signals from the globalpresencewrapper
 //         connect(m_globalPresenceWrapper, SIGNAL(presenceChanged()), m_qmlObject, SLOT(/*updatePresence*/));
+
+        // these two signals are for the plasmoid resize. QML can't determine the Plasma::DeclarativeWidget's boundaries
+        connect(this, SIGNAL(widthChanged()), m_qmlObject, SLOT(onWidthChanged()));
+        connect(this, SIGNAL(heightChanged()), m_qmlObject, SLOT(onHeightChanged()));
     }
 }
 
@@ -68,5 +82,7 @@ void TelepathyPresenceApplet::paintInterface(QPainter* p, const QStyleOptionGrap
     Plasma::Applet::paintInterface(p, option, contentsRect);
 }
 
+// This is the command that links your applet to the .desktop file
+K_EXPORT_PLASMA_APPLET(telepathy-kde-presence-applet, TelepathyPresenceApplet)
 
 
diff --git a/presence/src/presence-applet.h b/presence/src/presence-applet.h
index fdd192e..7d29586 100644
--- a/presence/src/presence-applet.h
+++ b/presence/src/presence-applet.h
@@ -28,10 +28,17 @@ class GlobalPresenceWrapper;
 class TelepathyPresenceApplet: public Plasma::Applet
 {
     Q_OBJECT
+
+    Q_PROPERTY(int height READ appletHeight)
+    Q_PROPERTY(int width READ appletWidth)
+
 public:
     TelepathyPresenceApplet(QObject *parent, const QVariantList &args);
     ~TelepathyPresenceApplet();
 
+    int appletHeight() const;
+    int appletWidth() const;
+
     void init();
     void paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect& contentsRect);
 

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list