[evolution-kolab/account-mgmt: 16/29] Replace e_cal_backend_notify_auth_required().



commit 524e11c4403a0675882c85901dbf831bf79dca6e
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Jun 29 14:51:42 2012 -0400

    Replace e_cal_backend_notify_auth_required().
    
    Instead call e_source_registry_authenticate_sync(), passing the
    KolabMailAccess instance as the ESourceAuthenticator.

 src/calendar/e-cal-backend-kolab.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-kolab.c b/src/calendar/e-cal-backend-kolab.c
index 69032ee..29c4bb2 100644
--- a/src/calendar/e-cal-backend-kolab.c
+++ b/src/calendar/e-cal-backend-kolab.c
@@ -255,6 +255,7 @@ e_cal_backend_kolab_open (ECalBackendSync *backend,
 {
 	ECalBackendKolab *self = NULL;
 	ECalBackendKolabPrivate *priv = NULL;
+	ESourceRegistry *registry;
 	ESource *esource = NULL;
 	CamelKolabIMAPXSettings *kolab_settings;
 	CamelNetworkSettings *network_settings;
@@ -285,11 +286,7 @@ e_cal_backend_kolab_open (ECalBackendSync *backend,
 
 	g_mutex_lock (&koma_objects_lock);
 
-	/* to trigger eds to pass along username and password, set the property
-	 * "auth" to "true" in the source setting:
-	 * <property name="auth" value="true"/>
-	 * <property name="username" value="..."/>
-	 */
+	registry = e_cal_backend_get_registry (E_CAL_BACKEND (backend));
 
 	icalkind = e_cal_backend_get_kind (E_CAL_BACKEND (backend));
 	/* TODO: this has to be set according to the get_kind() method */
@@ -480,10 +477,16 @@ e_cal_backend_kolab_open (ECalBackendSync *backend,
 		return;
 	}
 
-	/* do we need authentication data? if so, notify and return */
+	/* authenticate now if required */
 	if (auth_required) {
-		e_cal_backend_notify_auth_required (E_CAL_BACKEND (self), TRUE, NULL);
-		return;
+		ESourceAuthenticator *authenticator;
+
+		authenticator = E_SOURCE_AUTHENTICATOR (priv->cal_koma);
+
+		ok = e_source_registry_authenticate_sync (
+			registry, esource, authenticator, cancellable, error);
+		if (!ok)
+			return;
 	}
 
 	/* all good, notify that we're open for business */



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