[Telepathy-commits] [telepathy-qt4/master] Implement close() method in the convenience Channel class.

George Goldberg george.goldberg at collabora.co.uk
Wed Nov 19 06:03:09 PST 2008


Channel class should now implement wrappers around all needed methods from the ChannelInterface (using the SPEC version currently part of tpQt4.
---
 TelepathyQt4/cli-channel.cpp |    9 +++++++++
 TelepathyQt4/cli-channel.h   |    6 ++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/cli-channel.cpp b/TelepathyQt4/cli-channel.cpp
index 89bfb2a..c013677 100644
--- a/TelepathyQt4/cli-channel.cpp
+++ b/TelepathyQt4/cli-channel.cpp
@@ -447,6 +447,15 @@ uint Channel::targetHandle() const
     return mPriv->targetHandle;
 }
 
+void Channel::close()
+{
+    // Closing a channel only makes sense if the readiness is Full.
+    if(mPriv->readiness == ReadinessFull)
+        mPriv->baseInterface->Close();
+    else
+        warning() << "Channel::close() used with readiness" << mPriv->readiness << "!= ReadinessFull";
+}
+
 uint Channel::groupFlags() const
 {
     if (mPriv->readiness != ReadinessFull)
diff --git a/TelepathyQt4/cli-channel.h b/TelepathyQt4/cli-channel.h
index 71f0366..da4d5e1 100644
--- a/TelepathyQt4/cli-channel.h
+++ b/TelepathyQt4/cli-channel.h
@@ -187,6 +187,12 @@ public:
      */
     uint targetHandle() const;
 
+public Q_SLOTS:
+    /**
+     * Close the channel.
+     */
+    void close();
+
 Q_SIGNALS:
     /**
      * Emitted whenever the readiness of the Channel changes.
-- 
1.5.6.5




More information about the Telepathy-commits mailing list