[telepathy-qt4/master] ContactManager: Added groupChanged signal.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Wed Jul 22 12:01:57 PDT 2009


---
 TelepathyQt4/contact-manager.cpp |   27 +++++++++++++++++++++++++++
 TelepathyQt4/contact-manager.h   |    7 +++++++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/contact-manager.cpp b/TelepathyQt4/contact-manager.cpp
index 6d7321b..3e2fd9d 100644
--- a/TelepathyQt4/contact-manager.cpp
+++ b/TelepathyQt4/contact-manager.cpp
@@ -76,6 +76,19 @@ struct ContactManager::Private
                 QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetID")).toString();
         contactListGroupsChannels.insert(id, contactListGroupChannel);
         parent->connect(contactListGroupChannel.data(),
+                SIGNAL(groupMembersChanged(
+                       const Tp::Contacts &,
+                       const Tp::Contacts &,
+                       const Tp::Contacts &,
+                       const Tp::Contacts &,
+                       const Tp::Channel::GroupMemberChangeDetails &)),
+                SLOT(onContactListGroupMembersChanged(
+                       const Tp::Contacts &,
+                       const Tp::Contacts &,
+                       const Tp::Contacts &,
+                       const Tp::Contacts &,
+                       const Tp::Channel::GroupMemberChangeDetails &)));
+        parent->connect(contactListGroupChannel.data(),
                 SIGNAL(invalidated(Tp::DBusProxy *, const QString &, const QString &)),
                 SLOT(onContactListGroupRemoved(Tp::DBusProxy *, const QString &, const QString &)));
         return id;
@@ -862,6 +875,20 @@ void ContactManager::onDenyChannelMembersChanged(
     }
 }
 
+void ContactManager::onContactListGroupMembersChanged(
+        const Tp::Contacts &groupMembersAdded,
+        const Tp::Contacts &groupLocalPendingMembersAdded,
+        const Tp::Contacts &groupRemotePendingMembersAdded,
+        const Tp::Contacts &groupMembersRemoved,
+        const Tp::Channel::GroupMemberChangeDetails &details)
+{
+    ChannelPtr contactListGroupChannel = ChannelPtr(
+            qobject_cast<Channel*>(sender()));
+    QString id = contactListGroupChannel->immutableProperties().value(
+            QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetID")).toString();
+    emit groupChanged(id);
+}
+
 void ContactManager::onContactListGroupRemoved(Tp::DBusProxy *proxy,
         const QString &errorName, const QString &errorMessage)
 {
diff --git a/TelepathyQt4/contact-manager.h b/TelepathyQt4/contact-manager.h
index 1399198..6ca6ea6 100644
--- a/TelepathyQt4/contact-manager.h
+++ b/TelepathyQt4/contact-manager.h
@@ -111,6 +111,7 @@ Q_SIGNALS:
     void presencePublicationRequested(const Tp::Contacts &contacts);
     void groupAdded(const QString &group);
     void groupRemoved(const QString &group);
+    void groupChanged(const QString &group);
 
 private Q_SLOTS:
     void onAliasesChanged(const Tp::AliasPairList &);
@@ -136,6 +137,12 @@ private Q_SLOTS:
         const Tp::Contacts &groupMembersRemoved,
         const Tp::Channel::GroupMemberChangeDetails &details);
 
+    void onContactListGroupMembersChanged(
+        const Tp::Contacts &groupMembersAdded,
+        const Tp::Contacts &groupLocalPendingMembersAdded,
+        const Tp::Contacts &groupRemotePendingMembersAdded,
+        const Tp::Contacts &groupMembersRemoved,
+        const Tp::Channel::GroupMemberChangeDetails &details);
     void onContactListGroupRemoved(Tp::DBusProxy *,
         const QString &, const QString &);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list