[SCM] ktp-kded-integration-module packaging branch, master, updated. debian/15.12.1-2-382-gbd961c2

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


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

The following commit has been merged in the master branch:
commit ae10a75b33fb8dede914a06cfea43e7153950375
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Fri Nov 4 17:24:35 2011 +0100

    Send a dbus signal when the presence plugins are setting presence message. Also make presence plugins report their name.
    
    Reviewed-by: David Edmundson
    REVIEW: 103013
---
 autoaway.cpp                   |  5 +++++
 autoaway.h                     |  1 +
 telepathy-kded-module-plugin.h |  2 ++
 telepathy-module.cpp           | 14 ++++++++++++++
 telepathy-mpris.cpp            | 13 +++++++++----
 telepathy-mpris.h              |  2 ++
 6 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/autoaway.cpp b/autoaway.cpp
index cb9b0e7..7c72024 100644
--- a/autoaway.cpp
+++ b/autoaway.cpp
@@ -48,6 +48,11 @@ AutoAway::~AutoAway()
 {
 }
 
+QString AutoAway::pluginName() const
+{
+    return QString::fromLatin1("auto-away");
+}
+
 void AutoAway::timeoutReached(int id)
 {
     if (!isEnabled()) {
diff --git a/autoaway.h b/autoaway.h
index 9b55937..e9eb1ae 100644
--- a/autoaway.h
+++ b/autoaway.h
@@ -37,6 +37,7 @@ public:
     ~AutoAway();
 
     void readConfig();
+    QString pluginName() const;
 
 public Q_SLOTS:
     void onSettingsChanged();
diff --git a/telepathy-kded-module-plugin.h b/telepathy-kded-module-plugin.h
index 6fb78b8..4f1aa78 100644
--- a/telepathy-kded-module-plugin.h
+++ b/telepathy-kded-module-plugin.h
@@ -37,6 +37,8 @@ public:
     bool isActive() const { return m_active; };
     bool isEnabled() const { return m_enabled; };
     int pluginPriority() const { return m_pluginPriority; };
+    /// Deriving classes must return a valid plugin name in this method
+    virtual QString pluginName() const = 0;
 
     Tp::Presence requestedPresence() const { return m_requestedPresence; };
 
diff --git a/telepathy-module.cpp b/telepathy-module.cpp
index c1ae5e9..4c71928 100644
--- a/telepathy-module.cpp
+++ b/telepathy-module.cpp
@@ -138,6 +138,13 @@ void TelepathyModule::onPluginActivated(bool active)
         }
 
         if (!m_globalPresence->onlineAccounts()->accounts().isEmpty()) {
+            //signal all global presence instances that they should not save global presence message
+            QDBusMessage message = QDBusMessage::createSignal(QLatin1String("/Telepathy"),
+                                                              QLatin1String( "org.kde.Telepathy"),
+                                                              QLatin1String("presenceChanger"));
+            message.setArguments(QList<QVariant>() << m_pluginStack.first()->pluginName());
+            QDBusConnection::sessionBus().send(message);
+
             m_globalPresence->setPresence(m_pluginStack.first()->requestedPresence());
         }
     } else {
@@ -152,6 +159,13 @@ void TelepathyModule::onPluginActivated(bool active)
 
         if (!m_globalPresence->onlineAccounts()->accounts().isEmpty()) {
             if (m_pluginStack.isEmpty()) {
+                //signal out that presences are back to user control
+                QDBusMessage message = QDBusMessage::createSignal(QLatin1String("/Telepathy"),
+                                                                  QLatin1String( "org.kde.Telepathy"),
+                                                                  QLatin1String("presenceChanger"));
+                message.setArguments(QList<QVariant>() << QString::fromLatin1("user"));
+                QDBusConnection::sessionBus().send(message);
+
                 m_globalPresence->restoreSavedPresence();
             } else {
                 m_globalPresence->setPresence(m_pluginStack.first()->requestedPresence());
diff --git a/telepathy-mpris.cpp b/telepathy-mpris.cpp
index dfee15e..8c3f39d 100644
--- a/telepathy-mpris.cpp
+++ b/telepathy-mpris.cpp
@@ -56,6 +56,11 @@ TelepathyMPRIS::~TelepathyMPRIS()
 {
 }
 
+QString TelepathyMPRIS::pluginName() const
+{
+    return QString::fromLatin1("telepathy-mpris");
+}
+
 void TelepathyMPRIS::onPlayerSignalReceived(const QString &interface, const QVariantMap &changedProperties, const QStringList &invalidatedProperties)
 {
     Q_UNUSED(interface)
@@ -158,10 +163,10 @@ void TelepathyMPRIS::detectPlayers()
             QDBusConnection::sessionBus().connect(
                 service,
                 QLatin1String("/org/mpris/MediaPlayer2"),
-                                                QLatin1String("org.freedesktop.DBus.Properties"),
-                                                QLatin1String("PropertiesChanged"),
-                                                this,
-                                                SLOT(onPlayerSignalReceived(const QString&, const QVariantMap&, const QStringList& )) );
+                QLatin1String("org.freedesktop.DBus.Properties"),
+                QLatin1String("PropertiesChanged"),
+                this,
+                SLOT(onPlayerSignalReceived(const QString&, const QVariantMap&, const QStringList& )) );
 
         }
 
diff --git a/telepathy-mpris.h b/telepathy-mpris.h
index fbcd237..d5f1b31 100644
--- a/telepathy-mpris.h
+++ b/telepathy-mpris.h
@@ -33,6 +33,8 @@ public:
     TelepathyMPRIS(GlobalPresence *globalPresence, QObject *parent = 0);
     virtual ~TelepathyMPRIS();
 
+    QString pluginName() const;
+
 public Q_SLOTS:
     void onPlayerSignalReceived(const QString &interface, const QVariantMap &changedProperties, const QStringList &invalidatedProperties);
     void onSettingsChanged();

-- 
ktp-kded-integration-module packaging



More information about the pkg-kde-commits mailing list