[Telepathy-commits] [telepathy-qt4/master] StreamedMediaChannel: Cache MediaStream::contact object.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Tue Mar 10 23:04:05 PDT 2009


---
 TelepathyQt4/Client/streamed-media-channel.cpp |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/TelepathyQt4/Client/streamed-media-channel.cpp b/TelepathyQt4/Client/streamed-media-channel.cpp
index 3318488..5656519 100644
--- a/TelepathyQt4/Client/streamed-media-channel.cpp
+++ b/TelepathyQt4/Client/streamed-media-channel.cpp
@@ -41,15 +41,16 @@ struct MediaStream::Private
             uint contactHandle, MediaStreamType type,
             MediaStreamState state, MediaStreamDirection direction,
             MediaStreamPendingSend pendingSend)
-        : id(id), contactHandle(contactHandle),
-          type(type), state(state), direction(direction),
-          pendingSend(pendingSend)
+        : id(id), type(type), state(state),
+          direction(direction), pendingSend(pendingSend)
     {
+        ContactManager *contactManager = channel->connection()->contactManager();
+        contact = contactManager->lookupContactByHandle(contactHandle);
     }
 
     StreamedMediaChannel *channel;
     uint id;
-    uint contactHandle;
+    QSharedPointer<Contact> contact;
     MediaStreamType type;
     MediaStreamState state;
     MediaStreamDirection direction;
@@ -83,8 +84,7 @@ uint MediaStream::id() const
 
 QSharedPointer<Contact> MediaStream::contact() const
 {
-    ContactManager *contactManager = mPriv->channel->connection()->contactManager();
-    return contactManager->lookupContactByHandle(mPriv->contactHandle);
+    return mPriv->contact;
 }
 
 Telepathy::MediaStreamState MediaStream::state() const
-- 
1.5.6.5




More information about the telepathy-commits mailing list