telepathy-idle: Hide IdleServerConnectionState

Simon McVittie smcv at kemper.freedesktop.org
Wed May 1 09:01:42 PDT 2013


Module: telepathy-idle
Branch: master
Commit: 43f86291262aeb29d81532bd6d11d91d152e5f36
URL:    http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=43f86291262aeb29d81532bd6d11d91d152e5f36

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Mon Apr 29 18:09:31 2013 +0100

Hide IdleServerConnectionState

---

 src/idle-server-connection.c |   11 +++++++++--
 src/idle-server-connection.h |    8 +-------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c
index 82fffdf..f1c7ce1 100644
--- a/src/idle-server-connection.c
+++ b/src/idle-server-connection.c
@@ -52,6 +52,12 @@ enum {
 	PROP_TLS_MANAGER
 };
 
+typedef enum {
+	SERVER_CONNECTION_STATE_NOT_CONNECTED,
+	SERVER_CONNECTION_STATE_CONNECTING,
+	SERVER_CONNECTION_STATE_CONNECTED
+} IdleServerConnectionState;
+
 struct _IdleServerConnectionPrivate {
 	gchar *host;
 	guint16 port;
@@ -599,9 +605,10 @@ gboolean idle_server_connection_send_finish(IdleServerConnection *conn, GAsyncRe
 	return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT(result), error);
 }
 
-IdleServerConnectionState idle_server_connection_get_state(IdleServerConnection *conn) {
+gboolean idle_server_connection_is_connected(IdleServerConnection *conn) {
 	IdleServerConnectionPrivate *priv = IDLE_SERVER_CONNECTION_GET_PRIVATE(conn);
-	return priv->state;
+
+	return priv->state == SERVER_CONNECTION_STATE_CONNECTED;
 }
 
 void idle_server_connection_set_tls(IdleServerConnection *conn, gboolean tls) {
diff --git a/src/idle-server-connection.h b/src/idle-server-connection.h
index 8ce36ca..1b595b7 100644
--- a/src/idle-server-connection.h
+++ b/src/idle-server-connection.h
@@ -31,12 +31,6 @@ typedef struct _IdleServerConnection IdleServerConnection;
 typedef struct _IdleServerConnectionClass IdleServerConnectionClass;
 
 typedef enum {
-	SERVER_CONNECTION_STATE_NOT_CONNECTED,
-	SERVER_CONNECTION_STATE_CONNECTING,
-	SERVER_CONNECTION_STATE_CONNECTED
-} IdleServerConnectionState;
-
-typedef enum {
 	SERVER_CONNECTION_STATE_REASON_ERROR,
 	SERVER_CONNECTION_STATE_REASON_REQUESTED
 } IdleServerConnectionStateReason;
@@ -77,7 +71,7 @@ void idle_server_connection_force_disconnect(IdleServerConnection *conn);
 gboolean idle_server_connection_disconnect_finish(IdleServerConnection *conn, GAsyncResult *result, GError **error);
 void idle_server_connection_send_async(IdleServerConnection *conn, const gchar *cmd, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
 gboolean idle_server_connection_send_finish(IdleServerConnection *conn, GAsyncResult *result, GError **error);
-IdleServerConnectionState idle_server_connection_get_state(IdleServerConnection *conn);
+gboolean idle_server_connection_is_connected(IdleServerConnection *conn);
 void idle_server_connection_set_tls(IdleServerConnection *conn, gboolean tls);
 
 G_END_DECLS



More information about the telepathy-commits mailing list