[Telepathy-commits] [telepathy-qt4/master] Contact: Added ContactPtr typedef.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Wed Mar 18 10:27:08 PDT 2009


---
 TelepathyQt4/Client/contact.cpp |   20 ++++++++++----------
 TelepathyQt4/Client/contact.h   |    7 ++++---
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/TelepathyQt4/Client/contact.cpp b/TelepathyQt4/Client/contact.cpp
index 4ee49e2..056396d 100644
--- a/TelepathyQt4/Client/contact.cpp
+++ b/TelepathyQt4/Client/contact.cpp
@@ -167,37 +167,37 @@ Contact::PresenceState Contact::publishState() const
 
 PendingOperation *Contact::requestPresenceSubscription(const QString &message)
 {
-    QSharedPointer<Contact> self =
+    ContactPtr self =
         mPriv->manager->lookupContactByHandle(mPriv->handle[0]);
     return mPriv->manager->requestPresenceSubscription(
-            QList<QSharedPointer<Contact> >() << self,
+            QList<ContactPtr >() << self,
             message);
 }
 
 PendingOperation *Contact::removePresenceSubscription(const QString &message)
 {
-    QSharedPointer<Contact> self =
+    ContactPtr self =
         mPriv->manager->lookupContactByHandle(mPriv->handle[0]);
     return mPriv->manager->removePresenceSubscription(
-            QList<QSharedPointer<Contact> >() << self,
+            QList<ContactPtr>() << self,
             message);
 }
 
 PendingOperation *Contact::authorizePresencePublication(const QString &message)
 {
-    QSharedPointer<Contact> self =
+    ContactPtr self =
         mPriv->manager->lookupContactByHandle(mPriv->handle[0]);
     return mPriv->manager->authorizePresencePublication(
-            QList<QSharedPointer<Contact> >() << self,
+            QList<ContactPtr>() << self,
             message);
 }
 
 PendingOperation *Contact::removePresencePublication(const QString &message)
 {
-    QSharedPointer<Contact> self =
+    ContactPtr self =
         mPriv->manager->lookupContactByHandle(mPriv->handle[0]);
     return mPriv->manager->removePresencePublication(
-            QList<QSharedPointer<Contact> >() << self,
+            QList<ContactPtr>() << self,
             message);
 }
 
@@ -208,10 +208,10 @@ bool Contact::isBlocked() const
 
 PendingOperation *Contact::block(bool value)
 {
-    QSharedPointer<Contact> self =
+    ContactPtr self =
         mPriv->manager->lookupContactByHandle(mPriv->handle[0]);
     return mPriv->manager->blockContacts(
-            QList<QSharedPointer<Contact> >() << self,
+            QList<ContactPtr>() << self,
             value);
 }
 
diff --git a/TelepathyQt4/Client/contact.h b/TelepathyQt4/Client/contact.h
index bb71882..a5706be 100644
--- a/TelepathyQt4/Client/contact.h
+++ b/TelepathyQt4/Client/contact.h
@@ -101,7 +101,7 @@ Q_SIGNALS:
 
     // TODO: consider how the Renaming interface should work and map to Contacts
     // I guess it would be something like:
-    // void renamedTo(QSharedPointer<Telepathy::Client::Contact>)
+    // void renamedTo(Telepathy::Client::ContactPtr)
     // with that contact getting the same features requested as the current one. Or would we rather
     // want to signal that change right away with a handle?
 
@@ -127,9 +127,10 @@ private:
     Private *mPriv;
 };
 
-typedef QSet<QSharedPointer<Contact> > Contacts;
+typedef QSharedPointer<Contact> ContactPtr;
+typedef QSet<ContactPtr> Contacts;
 
-inline uint qHash(const QSharedPointer<Contact> &contact)
+inline uint qHash(const ContactPtr &contact)
 {
     return qHash(contact.data());
 }
-- 
1.5.6.5




More information about the telepathy-commits mailing list