summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2013-04-29 18:09:31 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2013-04-29 18:09:31 +0100
commit43f86291262aeb29d81532bd6d11d91d152e5f36 (patch)
treedccfec58ff6fa5a0cfc8b6604ab2e52bb2114a13
parent8e4889f1d154b0a483c583e1eedba09f5ca8a2bb (diff)
Hide IdleServerConnectionState
-rw-r--r--src/idle-server-connection.c11
-rw-r--r--src/idle-server-connection.h8
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