[evolution-data-server/account-mgmt] online-accounts: Add more EWS presence checks.



commit fff19dba448c8e2301de88108479206647ae71cd
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed May 30 15:09:41 2012 -0400

    online-accounts: Add more EWS presence checks.

 modules/online-accounts/module-online-accounts.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/modules/online-accounts/module-online-accounts.c b/modules/online-accounts/module-online-accounts.c
index fc165e8..9bcede7 100644
--- a/modules/online-accounts/module-online-accounts.c
+++ b/modules/online-accounts/module-online-accounts.c
@@ -189,11 +189,24 @@ online_accounts_config_exchange (EOnlineAccounts *extension,
 	const gchar *extension_name;
 	gchar *as_url = NULL;
 	gchar *oab_url = NULL;
+	gpointer class;
 	GError *error = NULL;
 
 	if (goa_object_peek_exchange (goa_object) == NULL)
 		return;
 
+	/* This should force the ESourceCamelEws type to be registered.
+	 * It will also tell us if Evolution-EWS is even installed. */
+	class = g_type_class_ref (g_type_from_name ("EEwsBackend"));
+	if (class != NULL) {
+		g_type_class_unref (class);
+	} else {
+		g_critical (
+			"%s: Could not locate EEwsBackendClass. "
+			"Is Evolution-EWS installed?", G_STRFUNC);
+		return;
+	}
+
 	/* XXX GNOME Online Accounts already runs autodiscover to test
 	 *     the user-entered values but doesn't share the discovered
 	 *     URLs.  It only provides us a host name and expects us to
@@ -227,12 +240,17 @@ online_accounts_config_exchange (EOnlineAccounts *extension,
 	source_extension = e_source_get_extension (source, extension_name);
 
 	/* This will be NULL if Evolution-EWS is not installed. */
-	if (source_extension != NULL)
+	if (source_extension != NULL) {
 		g_object_set (
 			source_extension,
 			"hosturl", as_url,
 			"oaburl", oab_url,
 			NULL);
+	} else {
+		g_critical (
+			"%s: Failed to create [%s] extension",
+			G_STRFUNC, extension_name);
+	}
 
 	g_free (as_url);
 	g_free (oab_url);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]