From: Matthew Barnes Date: Wed, 20 Feb 2013 16:20:10 +0000 (-0500) Subject: EBackend: Use e_source_authentication_ref_connectable(). X-Git-Tag: upstream/3.7.91~120 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54931cbe20e1518aed17a7bbbd175f7e56af447a;p=platform%2Fupstream%2Fevolution-data-server.git EBackend: Use e_source_authentication_ref_connectable(). Initialize the GSocketConnectable directly from ESourceAuthentication's GSocketConnectable, rather than building a new instance from its "host" and "port" properties. --- diff --git a/libebackend/e-backend.c b/libebackend/e-backend.c index 7296b6b..6a291e5 100644 --- a/libebackend/e-backend.c +++ b/libebackend/e-backend.c @@ -300,32 +300,19 @@ backend_constructed (GObject *object) /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_backend_parent_class)->constructed (object); - /* Create an initial GSocketConnectable from the data + /* Get an initial GSocketConnectable from the data * source's [Authentication] extension, if present. */ source = e_backend_get_source (backend); extension_name = E_SOURCE_EXTENSION_AUTHENTICATION; if (e_source_has_extension (source, extension_name)) { ESourceAuthentication *extension; - gchar *host; - guint16 port; extension = e_source_get_extension (source, extension_name); - host = e_source_authentication_dup_host (extension); - port = e_source_authentication_get_port (extension); - - /* XXX We should realy check both host and port, but - * too many backends neglect to set a port number. - * Need to fix that first before we can insist on - * a valid port number. */ - if (host != NULL) { - GSocketConnectable *connectable; - connectable = g_network_address_new (host, port); - e_backend_set_connectable (backend, connectable); - g_object_unref (connectable); - } + backend->priv->connectable = + e_source_authentication_ref_connectable (extension); - g_free (host); + backend_update_online_state (backend); } }