[Telepathy-commits] [telepathy-qt4/master] ContactManager: Store ReferencedHandles instead of uint on ContactListChannel.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Wed Feb 25 09:36:06 PST 2009


---
 TelepathyQt4/Client/connection.cpp    |    7 ++++---
 TelepathyQt4/Client/contact-manager.h |    9 +++++----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/TelepathyQt4/Client/connection.cpp b/TelepathyQt4/Client/connection.cpp
index 21dc23d..4879a0f 100644
--- a/TelepathyQt4/Client/connection.cpp
+++ b/TelepathyQt4/Client/connection.cpp
@@ -958,12 +958,12 @@ void Connection::gotContactListsHandles(PendingOperation *op)
 
     Q_ASSERT(pending->handles().size() == 1);
     Q_ASSERT(pending->namesRequested().size() == 1);
-    uint handle = pending->handles()[0];
+    ReferencedHandles handle = pending->handles();
     uint type = ContactManager::ContactListChannel::typeForIdentifier(
             pending->namesRequested().first());
     Q_ASSERT(type != (uint) -1 && type < ContactManager::ContactListChannel::LastType);
     mPriv->contactListsChannels[type].handle = handle;
-    request[QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetHandle")] = handle;
+    request[QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetHandle")] = handle[0];
     connect(ensureChannel(request),
             SIGNAL(finished(Telepathy::Client::PendingOperation*)),
             SLOT(gotContactListChannel(Telepathy::Client::PendingOperation*)));
@@ -982,7 +982,8 @@ void Connection::gotContactListChannel(PendingOperation *op)
     Q_ASSERT(!channel.isNull());
     Q_ASSERT(handle);
     for (int i = 0; i < ContactManager::ContactListChannel::LastType; ++i) {
-        if (mPriv->contactListsChannels[i].handle == handle) {
+        if (mPriv->contactListsChannels[i].handle.size() > 0 &&
+            mPriv->contactListsChannels[i].handle[0] == handle) {
             Q_ASSERT(mPriv->contactListsChannels[i].channel.isNull());
             mPriv->contactListsChannels[i].channel = channel;
             connect(channel->becomeReady(),
diff --git a/TelepathyQt4/Client/contact-manager.h b/TelepathyQt4/Client/contact-manager.h
index 87b3ae6..e3892ca 100644
--- a/TelepathyQt4/Client/contact-manager.h
+++ b/TelepathyQt4/Client/contact-manager.h
@@ -35,6 +35,7 @@
 #include <TelepathyQt4/Types>
 #include <TelepathyQt4/Client/Contact>
 #include <TelepathyQt4/Client/Channel>
+#include <TelepathyQt4/Client/ReferencedHandles>
 
 namespace Telepathy
 {
@@ -111,12 +112,12 @@ class ContactManager : public QObject
             };
 
             ContactListChannel()
-                : type((Type) -1), handle(0)
+                : type((Type) -1)
             {
             }
 
-            ContactListChannel(Type type, uint handle = 0)
-                : type(type), handle(handle)
+            ContactListChannel(Type type)
+                : type(type)
             {
             }
 
@@ -148,7 +149,7 @@ class ContactManager : public QObject
             }
 
             Type type;
-            uint handle;
+            ReferencedHandles handle;
             QSharedPointer<Channel> channel;
         };
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list