[evolution-data-server] EBackend: Use e_source_authentication_ref_connectable().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] EBackend: Use e_source_authentication_ref_connectable().
- Date: Wed, 20 Feb 2013 16:41:02 +0000 (UTC)
commit 54931cbe20e1518aed17a7bbbd175f7e56af447a
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Feb 20 11:20:10 2013 -0500
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.
libebackend/e-backend.c | 25 ++++++-------------------
1 files changed, 6 insertions(+), 19 deletions(-)
---
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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]