[evolution-data-server/account-mgmt: 36/38] Adapt test-client-examine-auth.c to the new ESource API.



commit fa87f67aefe903ea8f04173987e07ce9c554e736
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed May 25 21:24:44 2011 -0400

    Adapt test-client-examine-auth.c to the new ESource API.

 tests/libedataserverui/test-client-examine-auth.c |   33 ++++++++------------
 1 files changed, 13 insertions(+), 20 deletions(-)
---
diff --git a/tests/libedataserverui/test-client-examine-auth.c b/tests/libedataserverui/test-client-examine-auth.c
index 3efee31..4f91864 100644
--- a/tests/libedataserverui/test-client-examine-auth.c
+++ b/tests/libedataserverui/test-client-examine-auth.c
@@ -1,14 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
-#include <libedataserver/e-source-group.h>
 #include <libedataserver/e-gdbus-templates.h>
 #include <libedataserverui/e-client-utils.h>
 #include <libedataserverui/e-passwords.h>
 
 static void stop_main_loop (gint stop_result);
 static void report_error (const gchar *operation, GError **error);
+#if 0  /* ACCOUNT_MGMT */
 static gpointer foreach_configured_source_async_start (ESource **source);
 static gboolean foreach_configured_source_async_next (gpointer *foreach_async_data, ESource **source);
+#endif /* ACCOUNT_MGMT */
 static gboolean foreach_async (void);
 
 static gint running_async = 0;
@@ -117,28 +118,14 @@ print_values (const ExtraValues *evals,
 static void
 identify_source (ESource *source)
 {
-	const gchar *name, *uri;
-	gchar *abs_uri = NULL;
+	const gchar *name, *uid;
 
 	g_return_if_fail (source != NULL);
 
-	name = e_source_peek_name (source);
-	if (!name)
-		name = "Unknown name";
+	uid = e_source_get_uid (source);
+	name = e_source_get_display_name (source);
 
-	uri = e_source_peek_absolute_uri (source);
-	if (!uri) {
-		abs_uri = e_source_build_absolute_uri (source);
-		uri = abs_uri;
-	}
-	if (!uri)
-		uri = e_source_peek_relative_uri (source);
-	if (!uri)
-		uri = "Unknown uri";
-
-	g_print ("\n   Checking source '%s' (%s)\n", name, uri);
-
-	g_free (abs_uri);
+	g_print ("\n   Checking source '%s' (%s)\n", name, uid);
 }
 
 static void client_opened_async (GObject *source_object, GAsyncResult *result, gpointer async_data);
@@ -150,6 +137,7 @@ continue_next_source (gpointer async_data)
 
 	g_return_if_fail (async_data != NULL);
 
+#if 0  /* ACCOUNT_MGMT */
 	while (async_data && foreach_configured_source_async_next (&async_data, &source)) {
 		identify_source (source);
 		e_client_utils_open_new (source, source_type, TRUE, NULL,
@@ -157,6 +145,7 @@ continue_next_source (gpointer async_data)
 			client_opened_async, async_data);
 		break;
 	}
+#endif /* ACCOUNT_MGMT */
 
 	if (!async_data) {
 		running_async--;
@@ -267,11 +256,13 @@ foreach_async (void)
 	gpointer async_data;
 	ESource *source = NULL;
 
+#if 0  /* ACCOUNT_MGMT */
 	async_data = foreach_configured_source_async_start (&source);
 	if (!async_data) {
 		stop_main_loop (1);
 		return FALSE;
 	}
+#endif /* ACCOUNT_MGMT */
 
 	running_async++;
 
@@ -310,6 +301,7 @@ get_main_loop_stop_result (void)
 	return main_stop_result;
 }
 
+#if 0  /* ACCOUNT_MGMT */
 struct ForeachConfiguredData
 {
 	ESourceList *source_list;
@@ -321,7 +313,7 @@ static gpointer
 foreach_configured_source_async_start (ESource **source)
 {
 	struct ForeachConfiguredData *async_data;
-	ESourceList *source_list = NULL;
+	ESourceRegistry *registry;
 	GError *error = NULL;
 
 	g_return_val_if_fail (source != NULL, NULL);
@@ -397,6 +389,7 @@ foreach_configured_source_async_next (gpointer *foreach_async_data,
 
 	return FALSE;
 }
+#endif /* ACCOUNT_MGMT */
 
 static void
 report_error (const gchar *operation,



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