[Telepathy-commits] [telepathy-qt4/master] StreamedMediaChannel: Removed removeStreams(UIntList) method and added removeStream(MediaStreamPtr) method.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Thu Mar 19 17:12:42 PDT 2009


Removed removeStreams(UIntList) as there is no need to have a method receiving
the stream ids, as the user will always have the stream pointer in case the
stream exists.
---
 TelepathyQt4/Client/streamed-media-channel.cpp |   21 +++++++++++----------
 TelepathyQt4/Client/streamed-media-channel.h   |    4 ++--
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/TelepathyQt4/Client/streamed-media-channel.cpp b/TelepathyQt4/Client/streamed-media-channel.cpp
index 6c3f6a9..0bad606 100644
--- a/TelepathyQt4/Client/streamed-media-channel.cpp
+++ b/TelepathyQt4/Client/streamed-media-channel.cpp
@@ -587,30 +587,31 @@ PendingOperation *StreamedMediaChannel::acceptCall()
 }
 
 /**
- * Remove the specified streams from this channel.
+ * Remove the specified stream from this channel.
  *
- * \param streams List of streams to remove.
+ * \param stream Stream to remove.
  * \return A PendingOperation which will emit PendingOperation::finished
  *         when the call has finished.
  */
-PendingOperation *StreamedMediaChannel::removeStreams(MediaStreams streams)
+PendingOperation *StreamedMediaChannel::removeStream(const MediaStreamPtr &stream)
 {
-    Telepathy::UIntList ids;
-    foreach (const MediaStreamPtr &stream, streams) {
-        ids << stream->id();
-    }
-    return removeStreams(ids);
+    return new PendingVoidMethodCall(this,
+            streamedMediaInterface()->RemoveStreams(UIntList() << stream->id()));
 }
 
 /**
  * Remove the specified streams from this channel.
  *
- * \param streams List of ids corresponding to the streams to remove.
+ * \param streams List of streams to remove.
  * \return A PendingOperation which will emit PendingOperation::finished
  *         when the call has finished.
  */
-PendingOperation *StreamedMediaChannel::removeStreams(const Telepathy::UIntList &ids)
+PendingOperation *StreamedMediaChannel::removeStreams(const MediaStreams &streams)
 {
+    Telepathy::UIntList ids;
+    foreach (const MediaStreamPtr &stream, streams) {
+        ids << stream->id();
+    }
     return new PendingVoidMethodCall(this,
             streamedMediaInterface()->RemoveStreams(ids));
 }
diff --git a/TelepathyQt4/Client/streamed-media-channel.h b/TelepathyQt4/Client/streamed-media-channel.h
index 41d5a04..c5ed877 100644
--- a/TelepathyQt4/Client/streamed-media-channel.h
+++ b/TelepathyQt4/Client/streamed-media-channel.h
@@ -145,8 +145,8 @@ public:
 
     PendingOperation *acceptCall();
 
-    PendingOperation *removeStreams(MediaStreams streams);
-    PendingOperation *removeStreams(const Telepathy::UIntList &ids);
+    PendingOperation *removeStream(const MediaStreamPtr &stream);
+    PendingOperation *removeStreams(const MediaStreams &streams);
 
     PendingMediaStreams *requestStream(
             const ContactPtr &contact,
-- 
1.5.6.5




More information about the telepathy-commits mailing list