[telepathy-qt4/master] ContactManager: Added removeGroup method.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Wed Jul 22 00:43:30 PDT 2009


---
 TelepathyQt4/contact-manager.cpp |   11 +++++++++++
 TelepathyQt4/contact-manager.h   |    1 +
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/contact-manager.cpp b/TelepathyQt4/contact-manager.cpp
index 8fc8068..b1014b3 100644
--- a/TelepathyQt4/contact-manager.cpp
+++ b/TelepathyQt4/contact-manager.cpp
@@ -174,6 +174,17 @@ PendingOperation *ContactManager::addGroup(const QString &group)
             QStringList() << group);
 }
 
+PendingOperation *ContactManager::removeGroup(const QString &group)
+{
+    if (!mPriv->contactListGroupsChannels.contains(group)) {
+        return new PendingFailure(this, TELEPATHY_ERROR_INVALID_ARGUMENT,
+                "Invalid group");
+    }
+
+    ChannelPtr channel = mPriv->contactListGroupsChannels[group];
+    return channel->requestClose();
+}
+
 Contacts ContactManager::groupContacts(const QString &group) const
 {
     if (!mPriv->contactListGroupsChannels.contains(group)) {
diff --git a/TelepathyQt4/contact-manager.h b/TelepathyQt4/contact-manager.h
index 8c5cf47..7f2ef63 100644
--- a/TelepathyQt4/contact-manager.h
+++ b/TelepathyQt4/contact-manager.h
@@ -57,6 +57,7 @@ public:
     QStringList allKnownGroups() const;
 
     PendingOperation *addGroup(const QString &group);
+    PendingOperation *removeGroup(const QString &group);
 
     Contacts groupContacts(const QString &group) const;
     PendingOperation *groupAddContacts(const QString &group,
-- 
1.5.6.5




More information about the telepathy-commits mailing list