[Telepathy-commits] [telepathy-qt4/master] Connection: Added requestConnect.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Sun Jan 25 09:51:40 PST 2009


---
 TelepathyQt4/Client/connection.cpp |   24 ++++++++++++++----------
 TelepathyQt4/Client/connection.h   |    2 ++
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/TelepathyQt4/Client/connection.cpp b/TelepathyQt4/Client/connection.cpp
index 7fda95b..61aba19 100644
--- a/TelepathyQt4/Client/connection.cpp
+++ b/TelepathyQt4/Client/connection.cpp
@@ -1073,16 +1073,6 @@ PendingChannel *Connection::requestChannel(const QString &channelType,
     return channel;
 }
 
-#if 0
-// FIXME: this is a 1:1 mapping of the method from TpPrototype, but
-// most likely what we really want as a high-level API is something
-// more analogous to tp_connection_call_when_ready() in telepathy-glib
-PendingOperation *Connection::requestConnect()
-{
-    return new PendingVoidMethodCall(this, baseInterface()->Connect());
-}
-#endif
-
 /**
  * Request handles of the given type for the given entities (contacts,
  * rooms, lists, etc.).
@@ -1274,6 +1264,20 @@ PendingOperation *Connection::becomeReady(Features requestedFeatures)
 }
 
 /**
+ * Start an asynchronous request that the connection be connected.
+ * The returned PendingOperation object will signal the success or failure
+ * of this request; under normal circumstances, it can be expected to
+ * succeed.
+ *
+ * \return A %PendingOperation, which will emit finished when the
+ *         Disconnect D-Bus method returns.
+ */
+PendingOperation *Connection::requestConnect()
+{
+    return new PendingVoidMethodCall(this, baseInterface()->Connect());
+}
+
+/**
  * Start an asynchronous request that the connection be disconnected.
  * The returned PendingOperation object will signal the success or failure
  * of this request; under normal circumstances, it can be expected to
diff --git a/TelepathyQt4/Client/connection.h b/TelepathyQt4/Client/connection.h
index 2fd17dc..62e56d9 100644
--- a/TelepathyQt4/Client/connection.h
+++ b/TelepathyQt4/Client/connection.h
@@ -138,6 +138,8 @@ public:
     PendingChannel *requestChannel(const QString &channelType,
                                    uint handleType, uint handle);
 
+    PendingOperation *requestConnect();
+
     PendingOperation *requestDisconnect();
 
     PendingHandles *requestHandles(uint handleType, const QStringList &names);
-- 
1.5.6.5




More information about the Telepathy-commits mailing list