[evolution/account-mgmt: 27/51] Adapt modules/startup-wizard to the new ESource API.



commit 267c78c23ac5a3d776209d384b4f663f345b4b1f
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Apr 25 15:18:41 2011 -0400

    Adapt modules/startup-wizard to the new ESource API.

 modules/startup-wizard/evolution-startup-wizard.c |   29 +++++++++++++++------
 1 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/modules/startup-wizard/evolution-startup-wizard.c b/modules/startup-wizard/evolution-startup-wizard.c
index c0cac8d..c9b10b9 100644
--- a/modules/startup-wizard/evolution-startup-wizard.c
+++ b/modules/startup-wizard/evolution-startup-wizard.c
@@ -22,14 +22,13 @@
 
 #include <glib/gi18n-lib.h>
 #include <libebackend/e-extension.h>
+#include <libedataserver/e-source-mail-account.h>
 
 #include <shell/e-shell.h>
 
 #include <e-util/e-alert-dialog.h>
 #include <e-util/e-import.h>
 
-#include <libemail-utils/e-account-utils.h>
-
 #include <mail/e-mail-backend.h>
 #include <mail/em-account-editor.h>
 
@@ -436,6 +435,7 @@ startup_wizard_new_assistant (EStartupWizard *extension)
 	EShell *shell;
 	EShellBackend *shell_backend;
 	EMailBackend *backend;
+	EMailSession *session;
 	EMAccountEditor *emae;
 	EConfig *config;
 	EConfigItem *config_item;
@@ -446,9 +446,10 @@ startup_wizard_new_assistant (EStartupWizard *extension)
 	shell_backend = e_shell_get_backend_by_name (shell, "mail");
 
 	backend = E_MAIL_BACKEND (shell_backend);
+	session = e_mail_backend_get_session (backend);
 
 	emae = em_account_editor_new (
-		NULL, EMAE_ASSISTANT, backend,
+		NULL, EMAE_ASSISTANT, session,
 		"org.gnome.evolution.mail.config.accountWizard");
 
 	config = E_CONFIG (emae->config);
@@ -533,9 +534,12 @@ startup_wizard_run (EStartupWizard *extension)
 {
 	EShell *shell;
 	GtkWidget *window;
-	EAccountList *account_list;
+	ESourceRegistry *registry;
+	const gchar *extension_name;
 	const gchar *startup_view;
 	gboolean express_mode;
+	gboolean have_account;
+	GList *list;
 
 	/* Accounts should now be loaded if there were any to load.
 	 * Check, and proceed with the Evolution Setup Assistant. */
@@ -544,8 +548,13 @@ startup_wizard_run (EStartupWizard *extension)
 	express_mode = e_shell_get_express_mode (shell);
 	startup_view = e_shell_get_startup_view (shell);
 
-	account_list = e_get_account_list ();
-	if (e_list_length (E_LIST (account_list)) > 0)
+	registry = e_shell_get_registry (shell);
+	extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT;
+	list = e_source_registry_list_sources (registry, extension_name);
+	have_account = (list != NULL);
+	g_list_free (list);
+
+	if (have_account)
 		return;
 
 	if (express_mode && g_strcmp0 (startup_view, "mail") != 0)
@@ -564,9 +573,13 @@ startup_wizard_run (EStartupWizard *extension)
 
 	gtk_main ();
 
-	if (e_list_length (E_LIST (account_list)) <= 0)
-		exit (0);
+	extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT;
+	list = e_source_registry_list_sources (registry, extension_name);
+	have_account = (list != NULL);
+	g_list_free (list);
 
+	if (!have_account)
+		exit(0);
 }
 
 static void



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