diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-01-18 13:59:52 +0100 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-05-12 12:30:41 +0200 |
commit | 7b1fdf9783ffb9e6527c48257de56edc62c2dbcc (patch) | |
tree | 3dca25361643ab0e5650ebd1da357a8fc4358f04 | |
parent | d59a3d1e54b1b23ce6666009565bf0426e46ecad (diff) |
connection: factor out signal_connected
-rw-r--r-- | telepathy-glib/connection.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index effcd8c4..9ef3e056 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -352,6 +352,26 @@ tp_connection_prepare_capabilities_async (TpProxy *proxy, } static void +signal_connected (TpConnection *self) +{ + /* we shouldn't have gone to status CONNECTED for any reason + * that isn't REQUESTED :-) */ + DEBUG ("%p: CORE and CONNECTED ready", self); + self->priv->status = TP_CONNECTION_STATUS_CONNECTED; + self->priv->status_reason = TP_CONNECTION_STATUS_REASON_REQUESTED; + self->priv->ready = TRUE; + + _tp_proxy_set_feature_prepared ((TpProxy *) self, + TP_CONNECTION_FEATURE_CONNECTED, TRUE); + _tp_proxy_set_feature_prepared ((TpProxy *) self, + TP_CONNECTION_FEATURE_CORE, TRUE); + + g_object_notify ((GObject *) self, "status"); + g_object_notify ((GObject *) self, "status-reason"); + g_object_notify ((GObject *) self, "connection-ready"); +} + +static void tp_connection_continue_introspection (TpConnection *self) { if (tp_proxy_get_invalidated (self) != NULL) @@ -371,21 +391,7 @@ tp_connection_continue_introspection (TpConnection *self) return; } - /* signal CONNECTED; we shouldn't have gone to status CONNECTED for any - * reason that isn't REQUESTED :-) */ - DEBUG ("%p: CORE and CONNECTED ready", self); - self->priv->status = TP_CONNECTION_STATUS_CONNECTED; - self->priv->status_reason = TP_CONNECTION_STATUS_REASON_REQUESTED; - self->priv->ready = TRUE; - - _tp_proxy_set_feature_prepared ((TpProxy *) self, - TP_CONNECTION_FEATURE_CONNECTED, TRUE); - _tp_proxy_set_feature_prepared ((TpProxy *) self, - TP_CONNECTION_FEATURE_CORE, TRUE); - - g_object_notify ((GObject *) self, "status"); - g_object_notify ((GObject *) self, "status-reason"); - g_object_notify ((GObject *) self, "connection-ready"); + signal_connected (self); } else { |