[Telepathy-commits] [telepathy-qt4/master] Will-review #3 redux: Change Channel::interfaces and Channel::channelType checks subtly to allow usage from Channel internals even before no public usage is allowed

Olli Salli olli.salli at collabora.co.uk
Sat Sep 20 12:29:22 PDT 2008


---
 TelepathyQt4/cli-channel.cpp |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/TelepathyQt4/cli-channel.cpp b/TelepathyQt4/cli-channel.cpp
index c2cd300..9fa787d 100644
--- a/TelepathyQt4/cli-channel.cpp
+++ b/TelepathyQt4/cli-channel.cpp
@@ -231,14 +231,20 @@ QStringList Channel::interfaces() const
     // list, so we don't want this to cause warnings.
     if (mPriv->readiness < ReadinessFull && mPriv->interfaces.empty())
         warning() << "Channel::interfaces() used possibly before the list of interfaces has been received";
+    else if (mPriv->readiness == ReadinessDead)
+        warning() << "Channel::interfaces() used with readiness ReadinessDead";
 
     return mPriv->interfaces;
 }
 
 QString Channel::channelType() const
 {
-    if (mPriv->readiness != ReadinessFull)
-        warning() << "Channel::channelType() used with readiness" << mPriv->readiness << "!= ReadinessFull;
+    // Similarly, we don't want warnings triggered when using the type interface
+    // proxies internally.
+    if (mPriv->readiness < ReadinessFull && mPriv->interfaces.empty())
+        warning() << "Channel::channelType() used possibly before the list of interfaces has been received";
+    else if (mPriv->readiness == ReadinessDead)
+        warning() << "Channel::channelType() used with readiness ReadinessDead";
 
     return mPriv->channelType;
 }
@@ -246,7 +252,7 @@ QString Channel::channelType() const
 uint Channel::targetHandleType() const
 {
     if (mPriv->readiness != ReadinessFull)
-        warning() << "Channel::targetHandleType() used with readiness" << mPriv->readiness << "!= ReadinessFull;
+        warning() << "Channel::targetHandleType() used with readiness" << mPriv->readiness << "!= ReadinessFull";
 
     return mPriv->targetHandleType;
 }
@@ -254,7 +260,7 @@ uint Channel::targetHandleType() const
 uint Channel::targetHandle() const
 {
     if (mPriv->readiness != ReadinessFull)
-        warning() << "Channel::channelType() used with readiness" << mPriv->readiness << "!= ReadinessFull;
+        warning() << "Channel::channelType() used with readiness" << mPriv->readiness << "!= ReadinessFull";
 
     return mPriv->targetHandle;
 }
-- 
1.5.6.5



More information about the Telepathy-commits mailing list