[Telepathy-commits] [telepathy-qt4/master] Future-proof the Connection::Readiness enum

Olli Salli olli.salli at collabora.co.uk
Mon Sep 22 04:58:09 PDT 2008


---
 TelepathyQt4/cli-connection.cpp |    2 +-
 TelepathyQt4/cli-connection.h   |   12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/TelepathyQt4/cli-connection.cpp b/TelepathyQt4/cli-connection.cpp
index 232f841..bbab9a4 100644
--- a/TelepathyQt4/cli-connection.cpp
+++ b/TelepathyQt4/cli-connection.cpp
@@ -181,8 +181,8 @@ struct Connection::Private
                 Q_ASSERT(newReadiness == ReadinessDead);
                 break;
             case ReadinessDead:
+            default:
                 Q_ASSERT(false);
-                break;
         }
 
         debug() << "Readiness changed from" << readiness << "to" << newReadiness;
diff --git a/TelepathyQt4/cli-connection.h b/TelepathyQt4/cli-connection.h
index 1908f2b..4fece7c 100644
--- a/TelepathyQt4/cli-connection.h
+++ b/TelepathyQt4/cli-connection.h
@@ -94,7 +94,7 @@ public:
          * The readiness can change to any other state depending on the result
          * of the initial state query to the remote object.
          */
-        ReadinessJustCreated,
+        ReadinessJustCreated = 0,
 
         /**
          * The remote object is in the Disconnected state and introspection
@@ -106,7 +106,7 @@ public:
          *
          * The readiness can change to ReadinessConnecting and ReadinessDead.
          */
-        ReadinessNotYetConnected,
+        ReadinessNotYetConnected = 5,
 
         /**
          * The remote object is in the Connecting state. Most functionality is
@@ -114,7 +114,7 @@ public:
          *
          * The readiness can change to ReadinessFull and ReadinessDead.
          */
-        ReadinessConnecting,
+        ReadinessConnecting = 10,
 
         /**
          * The connection is in the Connected state and all introspection
@@ -122,7 +122,7 @@ public:
          *
          * The readiness can change to ReadinessDead.
          */
-        ReadinessFull,
+        ReadinessFull = 15,
 
         /**
          * The remote object has gone into a state where it can no longer be
@@ -130,7 +130,9 @@ public:
          *
          * No further readiness changes are possible.
          */
-        ReadinessDead
+        ReadinessDead = 20,
+
+        _ReadinessInvalid = 0xffff
     };
 
     /**
-- 
1.5.6.5




More information about the Telepathy-commits mailing list