[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:07:32 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=43d411b

The following commit has been merged in the master branch:
commit 43d411b11b4196dcd2c7bcfd74593266c5dfbac5
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Tue Nov 20 11:47:12 2012 +0100

    Set all contacts to offline when account goes offline
    
    The presenceChanged(..) signal is never emitted (bug in tp-qt?)
    when the account disconnects and so Nepomuk is left with invalid
    contact presences. This sets all contacts to offline when
    the connection drops. The presence is re-set when the account
    is online thanks to the presenceChanged(..) being emitted for all contacts.
    
    Reviewed-by: David Edmundson
    REVIEW: 107385
---
 kpeople/nepomuk-feeder/contact.cpp | 12 ++++++++++++
 kpeople/nepomuk-feeder/contact.h   |  1 +
 2 files changed, 13 insertions(+)

diff --git a/kpeople/nepomuk-feeder/contact.cpp b/kpeople/nepomuk-feeder/contact.cpp
index af392db..f7b68e2 100644
--- a/kpeople/nepomuk-feeder/contact.cpp
+++ b/kpeople/nepomuk-feeder/contact.cpp
@@ -73,6 +73,12 @@ void Contact::init()
     connect(m_contact.data(),
             SIGNAL(avatarDataChanged(Tp::AvatarData)),
             SLOT(onAvatarDataChanged(Tp::AvatarData)));
+
+    if (!m_contact->manager().isNull()) {
+        connect(m_contact->manager()->connection().data(),
+                SIGNAL(statusChanged(Tp::ConnectionStatus)),
+                SLOT(onConectionStatusChanged(Tp::ConnectionStatus)));
+    }
     // FIXME: Connect to any other signals of sync-worthy properties here.
 
     // Emit a signal to notify the controller that a new contact has been created.
@@ -159,6 +165,12 @@ void Contact::onAvatarDataChanged(const Tp::AvatarData &avatar)
     emit avatarChanged(m_contact->id(), avatar);
 }
 
+void Contact::onConectionStatusChanged(Tp::ConnectionStatus status)
+{
+    if (status == Tp::ConnectionStatusDisconnected) {
+        emit presenceChanged(m_contact->id(), Tp::Presence::offline().barePresence());
+    }
+}
 
 #include "contact.moc"
 
diff --git a/kpeople/nepomuk-feeder/contact.h b/kpeople/nepomuk-feeder/contact.h
index e1e6142..ddb9045 100644
--- a/kpeople/nepomuk-feeder/contact.h
+++ b/kpeople/nepomuk-feeder/contact.h
@@ -64,6 +64,7 @@ private Q_SLOTS:
     void onSubscriptionStateChanged(Tp::Contact::PresenceState state);
     void onCapabilitiesChanged(const Tp::ContactCapabilities &capabilities);
     void onAvatarDataChanged(const Tp::AvatarData &avatar);
+    void onConectionStatusChanged(Tp::ConnectionStatus status);
 
 private:
     Q_DISABLE_COPY(Contact);

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list