[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:14:17 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-kded-module.git;a=commitdiff;h=d483067
The following commit has been merged in the master branch:
commit d483067529283805b27370aea49248c82d130025
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Mon Apr 9 12:58:03 2012 +0100
Only change the presence of already online accounts.
---
telepathy-module.cpp | 14 ++++++++++++--
telepathy-module.h | 3 ++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/telepathy-module.cpp b/telepathy-module.cpp
index f834b43..22bd10f 100644
--- a/telepathy-module.cpp
+++ b/telepathy-module.cpp
@@ -146,10 +146,20 @@ void TelepathyModule::onPluginActivated(bool active)
{
Q_UNUSED(active);
//a plugin has changed state, set presence to whatever a plugin thinks it should be (or restore users setting)
- m_globalPresence->setPresence(currentPluginPresence());
+ setPresence(currentPluginPresence());
}
-KTp::Presence TelepathyModule::currentPluginPresence()
+void TelepathyModule::setPresence(const KTp::Presence &presence)
+{
+ Q_FOREACH(const Tp::AccountPtr &account, m_accountManager->allAccounts()) {
+ //change the state of any online account.
+ if (account->isEnabled() && account->isOnline()) {
+ account->setRequestedPresence(presence);
+ }
+ }
+}
+
+KTp::Presence TelepathyModule::currentPluginPresence() const
{
//search plugins in priority order. If a plugin is active, return the state it thinks it should be in.
Q_FOREACH(TelepathyKDEDModulePlugin* plugin, m_pluginStack) {
diff --git a/telepathy-module.h b/telepathy-module.h
index 3c94576..b7681d1 100644
--- a/telepathy-module.h
+++ b/telepathy-module.h
@@ -58,7 +58,8 @@ private Q_SLOTS:
private:
/** Returns the presence we think we should be in. Either from the highest priority plugin, or if none are active, the last user set.*/
- KTp::Presence currentPluginPresence();
+ KTp::Presence currentPluginPresence() const;
+ void setPresence(const KTp::Presence &presence);
private:
Tp::AccountManagerPtr m_accountManager;
--
ktp-kded-integration-module packaging
More information about the pkg-kde-commits
mailing list