evolution r37135 - in branches/kill-bonobo: composer e-util mail plugins/groupwise-features plugins/imap-features shell



Author: mbarnes
Date: Mon Jan 26 22:18:58 2009
New Revision: 37135
URL: http://svn.gnome.org/viewvc/evolution?rev=37135&view=rev

Log:
Split EAccountList and ESignatureList management out of the mail module.
This reduces the dependency of the composer on the mail module, which is
currently a circular dependency.


Added:
   branches/kill-bonobo/e-util/e-account-utils.c
   branches/kill-bonobo/e-util/e-account-utils.h
   branches/kill-bonobo/e-util/e-signature-utils.c
   branches/kill-bonobo/e-util/e-signature-utils.h
Modified:
   branches/kill-bonobo/composer/e-msg-composer.c
   branches/kill-bonobo/e-util/Makefile.am
   branches/kill-bonobo/mail/e-mail-shell-module-migrate.c
   branches/kill-bonobo/mail/e-mail-shell-module-settings.c
   branches/kill-bonobo/mail/e-mail-shell-module.c
   branches/kill-bonobo/mail/e-mail-shell-view-actions.c
   branches/kill-bonobo/mail/e-mail-shell-view-private.h
   branches/kill-bonobo/mail/em-account-editor.c
   branches/kill-bonobo/mail/em-account-prefs.c
   branches/kill-bonobo/mail/em-composer-prefs.c
   branches/kill-bonobo/mail/em-composer-utils.c
   branches/kill-bonobo/mail/em-folder-tree-model.c
   branches/kill-bonobo/mail/em-folder-tree.c
   branches/kill-bonobo/mail/em-subscribe-editor.c
   branches/kill-bonobo/mail/em-utils.c
   branches/kill-bonobo/mail/mail-component.c
   branches/kill-bonobo/mail/mail-config.c
   branches/kill-bonobo/mail/mail-config.h
   branches/kill-bonobo/mail/mail-ops.c
   branches/kill-bonobo/mail/mail-send-recv.c
   branches/kill-bonobo/mail/mail-signature-editor.c
   branches/kill-bonobo/mail/mail-vfolder.c
   branches/kill-bonobo/plugins/groupwise-features/proxy-login.c
   branches/kill-bonobo/plugins/imap-features/imap-headers.c
   branches/kill-bonobo/shell/e-shell-settings.h

Modified: branches/kill-bonobo/composer/e-msg-composer.c
==============================================================================
--- branches/kill-bonobo/composer/e-msg-composer.c	(original)
+++ branches/kill-bonobo/composer/e-msg-composer.c	Mon Jan 26 22:18:58 2009
@@ -23,17 +23,6 @@
  *
  */
 
-/*
-
-   TODO
-
-   - Somehow users should be able to see if any file (s) are attached even when
-     the attachment bar is not shown.
-
-   Should use EventSources to keep track of global changes made to configuration
-   values.  Right now it ignores the problem olympically. Miguel.
-*/
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -65,6 +54,8 @@
 #include "e-util/e-mktemp.h"
 #include "e-util/e-plugin-ui.h"
 #include "e-util/e-util-private.h"
+#include "e-util/e-account-utils.h"
+#include "e-util/e-signature-utils.h"
 #include "e-signature-combo-box.h"
 #include "shell/e-shell.h"
 
@@ -1683,7 +1674,7 @@
 		bcc_addrs = account->bcc_addrs;
 
 	uid = account->id->sig_uid;
-	signature = uid ? mail_config_get_signature_by_uid (uid) : NULL;
+	signature = uid ? e_get_signature_by_uid (uid) : NULL;
 	e_composer_header_table_set_signature (table, signature);
 
 	/* XXX This should be done more generically.  The composer
@@ -2776,9 +2767,9 @@
 	/* Configure Headers */
 
 	e_composer_header_table_set_account_list (
-		table, mail_config_get_accounts ());
+		table, e_get_account_list ());
 	e_composer_header_table_set_signature_list (
-		table, mail_config_get_signatures ());
+		table, e_get_signature_list ());
 
 	g_signal_connect_swapped (
 		table, "notify::account",
@@ -3364,11 +3355,11 @@
 	data = gtkhtml_editor_get_paragraph_data (editor, "signature_name");
 	if (g_str_has_prefix (data, "uid:")) {
 		decoded = decode_signature_name (data + 4);
-		signature = mail_config_get_signature_by_uid (decoded);
+		signature = e_get_signature_by_uid (decoded);
 		g_free (decoded);
 	} else if (g_str_has_prefix (data, "name:")) {
 		decoded = decode_signature_name (data + 5);
-		signature = mail_config_get_signature_by_name (decoded);
+		signature = e_get_signature_by_name (decoded);
 		g_free (decoded);
 	}
 
@@ -3437,10 +3428,12 @@
 		account_name = g_strdup (account_name);
 		g_strstrip (account_name);
 
-		if ((account = mail_config_get_account_by_uid (account_name)) == NULL)
-			/* 'old' setting */
-			account = mail_config_get_account_by_name (account_name);
-		if (account) {
+		account = e_get_account_by_uid (account_name);
+		if (account == NULL)
+			/* XXX Backwards compatibility */
+			account = e_get_account_by_name (account_name);
+
+		if (account != NULL) {
 			g_free (account_name);
 			account_name = g_strdup (account->name);
 		}

Modified: branches/kill-bonobo/e-util/Makefile.am
==============================================================================
--- branches/kill-bonobo/e-util/Makefile.am	(original)
+++ branches/kill-bonobo/e-util/Makefile.am	Mon Jan 26 22:18:58 2009
@@ -40,6 +40,7 @@
 privsolib_LTLIBRARIES = libeutil.la libeconduit.la
 
 eutilinclude_HEADERS = 				\
+	e-account-utils.h			\
 	e-bconf-map.h				\
 	e-binding.h				\
 	e-categories-config.h			\
@@ -70,6 +71,7 @@
 	e-request.h				\
 	e-signature.h				\
 	e-signature-list.h			\
+	e-signature-utils.h			\
 	e-bit-array.h				\
 	e-sorter.h				\
 	e-sorter-array.h			\
@@ -82,6 +84,7 @@
 
 libeutil_la_SOURCES =				\
 	$(eutilinclude_HEADERS)			\
+	e-account-utils.c			\
 	e-bconf-map.c				\
 	e-binding.c				\
 	e-categories-config.c			\
@@ -112,6 +115,7 @@
 	e-request.c				\
 	e-signature.c				\
 	e-signature-list.c			\
+	e-signature-utils.c			\
 	e-bit-array.c				\
 	e-sorter.c				\
 	e-sorter-array.c			\

Added: branches/kill-bonobo/e-util/e-account-utils.c
==============================================================================
--- (empty file)
+++ branches/kill-bonobo/e-util/e-account-utils.c	Mon Jan 26 22:18:58 2009
@@ -0,0 +1,96 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ */
+
+#include "e-account-utils.h"
+
+#include <gconf/gconf-client.h>
+
+static EAccountList *global_account_list;
+
+EAccountList *
+e_get_account_list (void)
+{
+	if (G_UNLIKELY (global_account_list == NULL)) {
+		GConfClient *client;
+
+		client = gconf_client_get_default ();
+		global_account_list = e_account_list_new (client);
+		g_object_unref (client);
+	}
+
+	g_return_val_if_fail (global_account_list != NULL, NULL);
+
+	return global_account_list;
+}
+
+EAccount *
+e_get_default_account (void)
+{
+	EAccountList *account_list;
+	const EAccount *account;
+
+	account_list = e_get_account_list ();
+	account = e_account_list_get_default (account_list);
+
+	/* XXX EAccountList misuses const. */
+	return (EAccount *) account;
+}
+
+void
+e_set_default_account (EAccount *account)
+{
+	EAccountList *account_list;
+
+	g_return_if_fail (E_IS_ACCOUNT (account));
+
+	account_list = e_get_account_list ();
+	e_account_list_set_default (account_list, account);
+}
+
+EAccount *
+e_get_account_by_name (const gchar *name)
+{
+	EAccountList *account_list;
+	const EAccount *account;
+	e_account_find_t find;
+
+	g_return_val_if_fail (name != NULL, NULL);
+
+	find = E_ACCOUNT_FIND_NAME;
+	account_list = e_get_account_list ();
+	account = e_account_list_find (account_list, find, name);
+
+	/* XXX EAccountList misuses const. */
+	return (EAccount *) account;
+}
+
+EAccount *
+e_get_account_by_uid (const gchar *uid)
+{
+	EAccountList *account_list;
+	const EAccount *account;
+	e_account_find_t find;
+
+	g_return_val_if_fail (uid != NULL, NULL);
+
+	find = E_ACCOUNT_FIND_UID;
+	account_list = e_get_account_list ();
+	account = e_account_list_find (account_list, find, uid);
+
+	/* XXX EAccountList misuses const. */
+	return (EAccount *) account;
+}

Added: branches/kill-bonobo/e-util/e-account-utils.h
==============================================================================
--- (empty file)
+++ branches/kill-bonobo/e-util/e-account-utils.h	Mon Jan 26 22:18:58 2009
@@ -0,0 +1,35 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ */
+
+#ifndef E_ACCOUNT_UTILS_H
+#define E_ACCOUNT_UTILS_H
+
+#include <glib.h>
+#include <libedataserver/e-account.h>
+#include <libedataserver/e-account-list.h>
+
+G_BEGIN_DECLS
+
+EAccountList *	e_get_account_list		(void);
+EAccount *	e_get_default_account		(void);
+void		e_set_default_account		(EAccount *account);
+EAccount *	e_get_account_by_name		(const gchar *name);
+EAccount *	e_get_account_by_uid		(const gchar *uid);
+
+G_END_DECLS
+
+#endif /* E_ACCOUNT_UTILS_H */

Added: branches/kill-bonobo/e-util/e-signature-utils.c
==============================================================================
--- (empty file)
+++ branches/kill-bonobo/e-util/e-signature-utils.c	Mon Jan 26 22:18:58 2009
@@ -0,0 +1,72 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ */
+
+#include "e-signature-utils.h"
+
+#include <gconf/gconf-client.h>
+
+static ESignatureList *global_signature_list;
+
+ESignatureList *
+e_get_signature_list (void)
+{
+	if (G_UNLIKELY (global_signature_list == NULL)) {
+		GConfClient *client;
+
+		client = gconf_client_get_default ();
+		global_signature_list = e_signature_list_new (client);
+		g_object_unref (client);
+	}
+
+	g_return_val_if_fail (global_signature_list != NULL, NULL);
+
+	return global_signature_list;
+}
+
+ESignature *
+e_get_signature_by_name (const gchar *name)
+{
+	ESignatureList *signature_list;
+	const ESignature *signature;
+	e_signature_find_t find;
+
+	g_return_val_if_fail (name != NULL, NULL);
+
+	find = E_SIGNATURE_FIND_NAME;
+	signature_list = e_get_signature_list ();
+	signature = e_signature_list_find (signature_list, find, name);
+
+	/* XXX ESignatureList misuses const. */
+	return (ESignature *) signature;
+}
+
+ESignature *
+e_get_signature_by_uid (const gchar *uid)
+{
+	ESignatureList *signature_list;
+	const ESignature *signature;
+	e_signature_find_t find;
+
+	g_return_val_if_fail (uid != NULL, NULL);
+
+	find = E_SIGNATURE_FIND_UID;
+	signature_list = e_get_signature_list ();
+	signature = e_signature_list_find (signature_list, find, uid);
+
+	/* XXX ESignatureList misuses const. */
+	return (ESignature *) signature;
+}

Added: branches/kill-bonobo/e-util/e-signature-utils.h
==============================================================================
--- (empty file)
+++ branches/kill-bonobo/e-util/e-signature-utils.h	Mon Jan 26 22:18:58 2009
@@ -0,0 +1,33 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ */
+
+#ifndef E_SIGNATURE_UTILS_H
+#define E_SIGNATURE_UTILS_H
+
+#include <glib.h>
+#include <e-util/e-signature.h>
+#include <e-util/e-signature-list.h>
+
+G_BEGIN_DECLS
+
+ESignatureList *e_get_signature_list		(void);
+ESignature *	e_get_signature_by_name		(const gchar *name);
+ESignature *	e_get_signature_by_uid		(const gchar *uid);
+
+G_END_DECLS
+
+#endif /* E_SIGNATURE_UTILS_H */

Modified: branches/kill-bonobo/mail/e-mail-shell-module-migrate.c
==============================================================================
--- branches/kill-bonobo/mail/e-mail-shell-module-migrate.c	(original)
+++ branches/kill-bonobo/mail/e-mail-shell-module-migrate.c	Mon Jan 26 22:18:58 2009
@@ -56,12 +56,12 @@
 #include <libedataserver/e-data-server-util.h>
 #include <e-util/e-xml-utils.h>
 
+#include "e-util/e-account-utils.h"
 #include "e-util/e-bconf-map.h"
-#include "libedataserver/e-account-list.h"
-#include "e-util/e-signature-list.h"
 #include "e-util/e-error.h"
 #include "e-util/e-util-private.h"
 #include "e-util/e-plugin.h"
+#include "e-util/e-signature-utils.h"
 
 #include "e-mail-shell-module.h"
 #include "shell/e-shell-migrate.h"
@@ -1999,7 +1999,7 @@
 	char *uid = NULL;
 	int i = 0;
 
-	list = mail_config_get_signatures ();
+	list = e_get_signature_list ();
 	iter = e_list_get_iterator ((EList *) list);
 
 	while (e_iterator_is_valid (iter) && i < id) {
@@ -2023,7 +2023,7 @@
 	EAccountList *accounts;
 	EIterator *iter;
 
-	if (!(accounts = mail_config_get_accounts ()))
+	if (!(accounts = e_get_account_list ()))
 		return;
 
 	iter = e_list_get_iterator ((EList *) accounts);
@@ -2056,7 +2056,7 @@
 
 	g_object_unref (iter);
 
-	mail_config_save_accounts ();
+	e_account_list_save (accounts);
 }
 
 static gboolean
@@ -2475,7 +2475,7 @@
 	EAccountList *accounts;
 	const EAccount *account;
 
-	if (!(accounts = mail_config_get_accounts()))
+	if (!(accounts = e_get_account_list ()))
 		return TRUE;
 
 	gconf = gconf_client_get_default();
@@ -2671,7 +2671,7 @@
 	EIterator *iter;
 	gboolean changed = FALSE;
 
-	if (!(accounts = mail_config_get_accounts ()))
+	if (!(accounts = e_get_account_list ()))
 		return;
 
 	iter = e_list_get_iterator ((EList *) accounts);
@@ -2694,7 +2694,7 @@
 	g_object_unref (iter);
 
 	if (changed)
-		mail_config_save_accounts ();
+		e_account_list_save (accounts);
 }
 
 #endif	/* !G_OS_WIN32 */
@@ -2913,7 +2913,7 @@
 	CamelFolderInfo *info;
 	const gchar *data_dir;
 
-	if (!(accounts = mail_config_get_accounts ()))
+	if (!(accounts = e_get_account_list ()))
 		return;
 
 	iter = e_list_get_iterator ((EList *) accounts);

Modified: branches/kill-bonobo/mail/e-mail-shell-module-settings.c
==============================================================================
--- branches/kill-bonobo/mail/e-mail-shell-module-settings.c	(original)
+++ branches/kill-bonobo/mail/e-mail-shell-module-settings.c	Mon Jan 26 22:18:58 2009
@@ -21,11 +21,19 @@
 
 #include "e-mail-shell-module-settings.h"
 
+#include <gconf/gconf-client.h>
+#include <libedataserver/e-account-list.h>
+
+#include "e-util/e-signature-list.h"
+
 void
 e_mail_shell_module_init_settings (EShell *shell)
 {
+	GConfClient *client;
 	EShellSettings *shell_settings;
+	gpointer object;
 
+	client = gconf_client_get_default ();
 	shell_settings = e_shell_get_shell_settings (shell);
 
 	/* XXX Default values should match the GConf schema.
@@ -425,4 +433,33 @@
 	e_shell_settings_bind_to_gconf (
 		shell_settings, "composer-top-signature",
 		"/apps/evolution/mail/composer/top_signature");
+
+	/* These properties are not bound directly to GConf keys.
+	 * XXX Nor should they be stored in GConf to begin with. */
+
+	e_shell_settings_install_property (
+		g_param_spec_object (
+			"accounts",
+			NULL,
+			NULL,
+			E_TYPE_ACCOUNT_LIST,
+			G_PARAM_READWRITE));
+
+	object = e_account_list_new (client);
+	e_shell_settings_set_object (shell_settings, "accounts", object);
+	g_object_unref (object);
+
+	e_shell_settings_install_property (
+		g_param_spec_object (
+			"signatures",
+			NULL,
+			NULL,
+			E_TYPE_SIGNATURE_LIST,
+			G_PARAM_READWRITE));
+
+	object = e_signature_list_new (client);
+	e_shell_settings_set_object (shell_settings, "signatures", object);
+	g_object_unref (object);
+
+	g_object_unref (client);
 }

Modified: branches/kill-bonobo/mail/e-mail-shell-module.c
==============================================================================
--- branches/kill-bonobo/mail/e-mail-shell-module.c	(original)
+++ branches/kill-bonobo/mail/e-mail-shell-module.c	Mon Jan 26 22:18:58 2009
@@ -25,6 +25,7 @@
 #include <camel/camel-session.h>
 #include <camel/camel-url.h>
 
+#include "e-util/e-account-utils.h"
 #include "e-util/e-import.h"
 #include "e-util/e-util.h"
 #include "shell/e-shell.h"
@@ -353,7 +354,7 @@
 	EAccountList *account_list;
 	EIterator *iter;
 
-	account_list = mail_config_get_accounts ();
+	account_list = e_get_account_list ();
 
 	for (iter = e_list_get_iterator ((EList *) account_list);
 		e_iterator_is_valid (iter); e_iterator_next (iter)) {

Modified: branches/kill-bonobo/mail/e-mail-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/mail/e-mail-shell-view-actions.c	(original)
+++ branches/kill-bonobo/mail/e-mail-shell-view-actions.c	Mon Jan 26 22:18:58 2009
@@ -41,21 +41,21 @@
 	folder_uri = em_folder_tree_get_selected_uri (folder_tree);
 	g_return_if_fail (folder_uri != NULL);
 
+	account_list = e_get_account_list ();
 	account = mail_config_get_account_by_source_url (folder_uri);
 	g_return_if_fail (account != NULL);
 
-	if (mail_config_has_proxies (account))
-		mail_config_remove_account_proxies (account);
+	if (e_account_list_account_has_proxies (account_list, account))
+		e_account_list_remove_account_proxies (account_list, account);
 
 	account->enabled = !account->enabled;
-	account_list = mail_config_get_accounts ();
 	e_account_list_change (account_list, account);
 	e_mail_shell_module_remove_store_by_uri (shell_module, folder_uri);
 
 	if (account->parent_uid != NULL)
-		mail_config_remove_account (account);
+		e_account_list_remove (account_list, account);
 
-	mail_config_save_accounts ();
+	e_account_list_save (account_list);
 
 	g_free (folder_uri);
 }

Modified: branches/kill-bonobo/mail/e-mail-shell-view-private.h
==============================================================================
--- branches/kill-bonobo/mail/e-mail-shell-view-private.h	(original)
+++ branches/kill-bonobo/mail/e-mail-shell-view-private.h	Mon Jan 26 22:18:58 2009
@@ -31,6 +31,7 @@
 #include "e-util/e-util.h"
 #include "e-util/e-binding.h"
 #include "e-util/gconf-bridge.h"
+#include "e-util/e-account-utils.h"
 #include "widgets/misc/e-popup-action.h"
 #include "widgets/menus/gal-view-instance.h"
 

Modified: branches/kill-bonobo/mail/em-account-editor.c
==============================================================================
--- branches/kill-bonobo/mail/em-account-editor.c	(original)
+++ branches/kill-bonobo/mail/em-account-editor.c	Mon Jan 26 22:18:58 2009
@@ -51,10 +51,11 @@
 #include <libgnomeui/gnome-druid.h>
 #include <libgnomeui/gnome-druid-page-standard.h>
 
-#include <libedataserver/e-account-list.h>
 #include <e-util/e-signature-list.h>
 
 #include "e-util/e-error.h"
+#include "e-util/e-account-utils.h"
+#include "e-util/e-signature-utils.h"
 #include "e-util/e-util-private.h"
 
 #include "em-config.h"
@@ -210,7 +211,7 @@
 	EMAccountEditorPrivate *p = emae->priv;
 
 	if (p->sig_added_id) {
-		ESignatureList *signatures = mail_config_get_signatures();
+		ESignatureList *signatures = e_get_signature_list ();
 
 		g_signal_handler_disconnect(signatures, p->sig_added_id);
 		g_signal_handler_disconnect(signatures, p->sig_removed_id);
@@ -698,7 +699,7 @@
 	gtk_list_store_append(store, &iter);
 	gtk_list_store_set(store, &iter, 0, _("None"), 1, NULL, -1);
 
-	signatures = mail_config_get_signatures ();
+	signatures = e_get_signature_list ();
 
 	if (p->sig_added_id == 0) {
 		p->sig_added_id = g_signal_connect(signatures, "signature-added", G_CALLBACK(emae_signature_added), emae);
@@ -1791,8 +1792,8 @@
 	gui->management_frame = glade_xml_get_widget(xml, "management_frame");
 
 	gui->default_account = GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "management_default"));
-	if (!mail_config_get_default_account ()
-		|| (account == mail_config_get_default_account ())
+	if (!e_get_default_account ()
+		|| (account == e_get_default_account ())
 		|| (GPOINTER_TO_INT(g_object_get_data (G_OBJECT (emae->account), "default_flagged"))) )
 			gtk_toggle_button_set_active (gui->default_account, TRUE);
 
@@ -2729,7 +2730,7 @@
 				len = strlen(tmp);
 				template = alloca(len + 14);
 				strcpy(template, tmp);
-				while (mail_config_get_account_by_name(template))
+				while (e_get_account_by_name (template))
 					sprintf(template + len, " (%d)", i++);
 
 				gtk_entry_set_text(emae->priv->identity_entries[0], template);
@@ -2773,7 +2774,7 @@
 	if (ok && (pageid == NULL || !strcmp(pageid, "40.management"))) {
 		ok = (tmp = e_account_get_string(emae->account, E_ACCOUNT_NAME))
 			&& tmp[0]
-			&& ((ea = mail_config_get_account_by_name(tmp)) == NULL
+			&& ((ea = e_get_account_by_name (tmp)) == NULL
 			    || ea == emae->original);
 		if (!ok)
 			d(printf("management page incomplete\n"));
@@ -2801,7 +2802,7 @@
 emae_commit(EConfig *ec, GSList *items, void *data)
 {
 	EMAccountEditor *emae = data;
-	EAccountList *accounts = mail_config_get_accounts();
+	EAccountList *accounts = e_get_account_list ();
 	EAccount *account;
 
 	/* the mail-config*acconts* api needs a lot of work */

Modified: branches/kill-bonobo/mail/em-account-prefs.c
==============================================================================
--- branches/kill-bonobo/mail/em-account-prefs.c	(original)
+++ branches/kill-bonobo/mail/em-account-prefs.c	Mon Jan 26 22:18:58 2009
@@ -32,7 +32,7 @@
 #include "mail-ops.h"
 #include "mail-send-recv.h"
 
-#include "libedataserver/e-account-list.h"
+#include "e-util/e-account-utils.h"
 #include "e-util/e-error.h"
 #include "e-util/e-util-private.h"
 
@@ -174,6 +174,9 @@
 account_edit_clicked (GtkButton *button, gpointer user_data)
 {
 	EMAccountPrefs *prefs = (EMAccountPrefs *) user_data;
+	EAccountList *account_list;
+
+	account_list = e_get_account_list ();
 
 	if (prefs->editor == NULL) {
 		GtkTreeSelection *selection;
@@ -185,7 +188,7 @@
 		if (gtk_tree_selection_get_selected (selection, &model, &iter))
 			gtk_tree_model_get (model, &iter, 3, &account, -1);
 
-		if (account && !account->parent_uid && !mail_config_has_proxies (account)) {
+		if (account && !account->parent_uid && !e_account_list_account_has_proxies (account_list, account)) {
 			EMAccountEditor *emae;
 
 			/** @HookPoint-EMConfig: Mail Account Editor
@@ -222,6 +225,8 @@
 	int ans;
 	gboolean has_proxies = FALSE;
 
+	accounts = e_get_account_list ();
+
 	selection = gtk_tree_view_get_selection (prefs->table);
 	if (gtk_tree_selection_get_selected (selection, &model, &iter))
 		gtk_tree_model_get (model, &iter, 3, &account, -1);
@@ -230,7 +235,7 @@
 	if (account == NULL || prefs->editor != NULL)
 		return;
 
-	has_proxies = mail_config_has_proxies (account);
+	has_proxies = e_account_list_account_has_proxies (accounts, account);
 	ans = e_error_run(PREFS_WINDOW(prefs), has_proxies?"mail:ask-delete-account-with-proxies":"mail:ask-delete-account",NULL);
 
 	if (ans == GTK_RESPONSE_YES) {
@@ -243,11 +248,10 @@
 
 		/* remove all the proxies account has created*/
 		if (has_proxies)
-			mail_config_remove_account_proxies (account);
+			e_account_list_remove_account_proxies (accounts, account);
 
 		/* remove it from the config file */
-		mail_config_remove_account (account);
-		accounts = mail_config_get_accounts ();
+		e_account_list_remove (accounts, account);
 
 		mail_config_write ();
 
@@ -281,7 +285,7 @@
 		gtk_tree_model_get (model, &iter, 3, &account, -1);
 
 	if (account) {
-		mail_config_set_default_account (account);
+		e_set_default_account (account);
 
 		mail_config_write ();
 
@@ -312,11 +316,14 @@
 {
 	EMAccountPrefs *prefs = user_data;
 	GtkTreeSelection *selection;
+	EAccountList *account_list;
 	EAccount *account = NULL;
 	GtkTreeModel *model;
 	GtkTreePath *path;
 	GtkTreeIter iter;
 
+	account_list = e_get_account_list ();
+
 	path = gtk_tree_path_new_from_string (arg1);
 	model = gtk_tree_view_get_model (prefs->table);
 	selection = gtk_tree_view_get_selection (prefs->table);
@@ -324,7 +331,7 @@
 	if (gtk_tree_model_get_iter (model, &iter, path)) {
 		gtk_tree_model_get (model, &iter, 3, &account, -1);
 
-		if (mail_config_has_proxies (account)) {
+		if (e_account_list_account_has_proxies (account_list, account)) {
 			int ans;
 
 			ans = e_error_run(PREFS_WINDOW(prefs), "mail:ask-delete-proxy-accounts",NULL);
@@ -334,12 +341,12 @@
 				return;
 			}
 
-			mail_config_remove_account_proxies (account);
+			e_account_list_remove_account_proxies (account_list, account);
 			gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), 1);
 		}
 
 		account->enabled = !account->enabled;
-		e_account_list_change(mail_config_get_accounts(), account);
+		e_account_list_change(e_get_account_list (), account);
 		account_able_changed (account);
 		gtk_list_store_set ((GtkListStore *) model, &iter, 0, account->enabled, -1);
 
@@ -359,13 +366,16 @@
 static void
 account_cursor_change (GtkTreeSelection *selection, EMAccountPrefs *prefs)
 {
+	EAccountList *account_list;
 	EAccount *account = NULL;
 	GtkTreeModel *model;
 	GtkTreeIter iter;
  	const char *url = NULL;
 	int state;
 	EAccount *default_account;
-	default_account = mail_config_get_default_account ();
+
+	account_list = e_get_account_list ();
+	default_account = e_get_default_account ();
 
 	state = gconf_client_key_is_writable(mail_config_get_gconf_client(), "/apps/evolution/mail/accounts", NULL);
 	if (state) {
@@ -381,8 +391,12 @@
 		gtk_widget_set_sensitive (GTK_WIDGET (prefs), FALSE);
 	}
 
-	if( url != NULL )
-		gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), !mail_config_has_proxies(account));
+	if (url != NULL) {
+		gboolean has_proxies;
+
+		has_proxies = e_account_list_account_has_proxies (account_list, account);
+		gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), !has_proxies);
+	}
 
 	gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), state);
 
@@ -407,9 +421,9 @@
 	model = (GtkListStore *) gtk_tree_view_get_model (prefs->table);
 	gtk_list_store_clear (model);
 
-	default_account = mail_config_get_default_account ();
+	default_account = e_get_default_account ();
 
-	accounts = mail_config_get_accounts ();
+	accounts = e_get_account_list ();
 	node = e_list_get_iterator ((EList *) accounts);
 	selection = gtk_tree_view_get_selection(prefs->table);
 

Modified: branches/kill-bonobo/mail/em-composer-prefs.c
==============================================================================
--- branches/kill-bonobo/mail/em-composer-prefs.c	(original)
+++ branches/kill-bonobo/mail/em-composer-prefs.c	Mon Jan 26 22:18:58 2009
@@ -31,8 +31,7 @@
 #include <fcntl.h>
 
 #include "e-util/e-binding.h"
-#include "e-util/e-signature.h"
-#include "e-util/e-signature-list.h"
+#include "e-util/e-signature-utils.h"
 #include "e-util/gconf-bridge.h"
 
 #include "em-composer-prefs.h"
@@ -97,7 +96,7 @@
 	EMComposerPrefs *prefs = (EMComposerPrefs *) object;
 	ESignatureList *signature_list;
 
-	signature_list = mail_config_get_signatures ();
+	signature_list = e_get_signature_list ();
 
 	if (prefs->sig_added_id != 0) {
 		g_signal_handler_disconnect (
@@ -380,12 +379,19 @@
 	GtkTreeModel *model;
 	GtkTreeIter iter;
 	ESignature *signature;
+	ESignatureList *signature_list;
 
+	signature_list = e_get_signature_list ();
 	selection = gtk_tree_view_get_selection (prefs->sig_list);
 
 	if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
 		gtk_tree_model_get (model, &iter, 1, &signature, -1);
-		mail_config_remove_signature (signature);
+
+		if (signature->filename && !signature->script)
+			g_unlink (signature->filename);
+
+		e_signature_list_remove (signature_list, signature);
+		e_signature_list_save (signature_list);
 	}
 	gtk_widget_grab_focus ((GtkWidget *)prefs->sig_list);
 }
@@ -425,24 +431,27 @@
 			struct stat st;
 
 			if (g_stat (argv[0], &st) == 0 && S_ISREG (st.st_mode) && g_access (argv[0], X_OK) == 0) {
+				ESignatureList *signature_list;
 				ESignature *signature;
 
+				signature_list = e_get_signature_list ();
+
 				if ((signature = g_object_get_data ((GObject *) entry, "sig"))) {
 					/* we're just editing an existing signature script */
 					g_free (signature->name);
 					signature->name = g_strdup (name);
 					g_free(signature->filename);
 					signature->filename = g_strdup(script);
-					e_signature_list_change (mail_config_get_signatures (), signature);
+					e_signature_list_change (signature_list, signature);
 				} else {
 					signature = mail_config_signature_new (script, TRUE, TRUE);
 					signature->name = g_strdup (name);
 
-					e_signature_list_add (mail_config_get_signatures (), signature);
+					e_signature_list_add (signature_list, signature);
 					g_object_unref (signature);
 				}
 
-				mail_config_save_signatures();
+				e_signature_list_save (signature_list);
 
 				gtk_widget_hide (prefs->sig_script_dialog);
 				g_strfreev (argv);
@@ -505,7 +514,7 @@
 	model = gtk_tree_view_get_model (prefs->sig_list);
 	gtk_list_store_clear (GTK_LIST_STORE (model));
 
-	signature_list = mail_config_get_signatures ();
+	signature_list = e_get_signature_list ();
 	iterator = e_list_get_iterator ((EList *) signature_list);
 
 	while (e_iterator_is_valid (iterator)) {

Modified: branches/kill-bonobo/mail/em-composer-utils.c
==============================================================================
--- branches/kill-bonobo/mail/em-composer-utils.c	(original)
+++ branches/kill-bonobo/mail/em-composer-utils.c	Mon Jan 26 22:18:58 2009
@@ -39,6 +39,7 @@
 #include "mail-send-recv.h"
 
 #include "e-util/e-error.h"
+#include "e-util/e-account-utils.h"
 
 #include "em-utils.h"
 #include "em-composer-utils.h"
@@ -48,8 +49,6 @@
 #include "em-format-quote.h"
 #include "em-event.h"
 
-#include "libedataserver/e-account-list.h"
-
 #include <camel/camel-folder.h>
 #include <camel/camel-multipart.h>
 #include <camel/camel-string-utils.h>
@@ -1663,10 +1662,10 @@
 	EAccountList *accounts;
 	EIterator *iter;
 
-	accounts = mail_config_get_accounts ();
+	accounts = e_get_account_list ();
 	account_hash = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
 
-	def = mail_config_get_default_account ();
+	def = e_get_default_account ();
 
 	iter = e_list_get_iterator ((EList *) accounts);
 	while (e_iterator_is_valid (iter)) {

Modified: branches/kill-bonobo/mail/em-folder-tree-model.c
==============================================================================
--- branches/kill-bonobo/mail/em-folder-tree-model.c	(original)
+++ branches/kill-bonobo/mail/em-folder-tree-model.c	Mon Jan 26 22:18:58 2009
@@ -37,6 +37,7 @@
 
 #include "e-util/e-util.h"
 #include "e-util/e-mktemp.h"
+#include "e-util/e-account-utils.h"
 
 #include <glib/gi18n.h>
 
@@ -386,7 +387,7 @@
 		GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
 		GTK_SORT_ASCENDING);
 
-	model->accounts = mail_config_get_accounts ();
+	model->accounts = e_get_account_list ();
 	model->account_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
 	model->account_changed_id = g_signal_connect (
 		model->accounts, "account-changed",

Modified: branches/kill-bonobo/mail/em-folder-tree.c
==============================================================================
--- branches/kill-bonobo/mail/em-folder-tree.c	(original)
+++ branches/kill-bonobo/mail/em-folder-tree.c	Mon Jan 26 22:18:58 2009
@@ -48,6 +48,7 @@
 #include <camel/camel-file-utils.h>
 #include <camel/camel-stream-fs.h>
 
+#include "e-util/e-account-utils.h"
 #include "e-util/e-mktemp.h"
 #include "e-util/e-request.h"
 #include "e-util/e-icon-factory.h"
@@ -565,7 +566,7 @@
 	tree_view = GTK_TREE_VIEW (emft);
 	shell_module = em_folder_tree_model_get_shell_module (model);
 
-	if ((account = mail_config_get_account_by_uid (uid)) && account->enabled) {
+	if ((account = e_get_account_by_uid (uid)) && account->enabled) {
 		CamelException ex;
 
 		camel_exception_init (&ex);
@@ -634,7 +635,7 @@
 			    -1);
 
 	si = g_hash_table_lookup (model->store_hash, store);
-	if ((account = mail_config_get_account_by_name (si->display_name))) {
+	if ((account = e_get_account_by_name (si->display_name))) {
 	        key = g_strdup_printf ("%s/%s", account->uid, full_name ? full_name : "");
 	} else if (CAMEL_IS_VEE_STORE (store)) {
 		/* vfolder store */
@@ -1831,7 +1832,7 @@
 			    -1);
 
 	si = g_hash_table_lookup (priv->model->store_hash, store);
-	if ((account = mail_config_get_account_by_name (si->display_name))) {
+	if ((account = e_get_account_by_name (si->display_name))) {
 	        key = g_strdup_printf ("%s/%s", account->uid, full_name ? full_name : "");
 	} else if (CAMEL_IS_VEE_STORE (store)) {
 		/* vfolder store */

Modified: branches/kill-bonobo/mail/em-subscribe-editor.c
==============================================================================
--- branches/kill-bonobo/mail/em-subscribe-editor.c	(original)
+++ branches/kill-bonobo/mail/em-subscribe-editor.c	Mon Jan 26 22:18:58 2009
@@ -35,8 +35,9 @@
 #include "camel/camel-exception.h"
 #include "camel/camel-store.h"
 #include "camel/camel-session.h"
-#include "libedataserver/e-account-list.h"
 #include "libedataserver/e-msgport.h"
+
+#include "e-util/e-account-utils.h"
 #include "e-util/e-util-private.h"
 
 #include "em-subscribe-editor.h"
@@ -862,7 +863,7 @@
 	gtk_widget_show(w);
 	gtk_menu_shell_append ((GtkMenuShell *)menu, w);
 
-	accounts = mail_config_get_accounts ();
+	accounts = e_get_account_list ();
 	for (iter = e_list_get_iterator ((EList *) accounts);
 	     e_iterator_is_valid (iter);
 	     e_iterator_next (iter)) {

Modified: branches/kill-bonobo/mail/em-utils.c
==============================================================================
--- branches/kill-bonobo/mail/em-utils.c	(original)
+++ branches/kill-bonobo/mail/em-utils.c	Mon Jan 26 22:18:58 2009
@@ -67,7 +67,7 @@
 #include "e-util/e-util.h"
 #include "e-util/e-util-private.h"
 #include "e-util/e-mktemp.h"
-#include "libedataserver/e-account-list.h"
+#include "e-util/e-account-utils.h"
 #include "e-util/e-dialog-utils.h"
 #include "e-util/e-error.h"
 
@@ -194,6 +194,7 @@
 em_utils_configure_account (GtkWindow *parent)
 {
 	EMAccountEditor *emae;
+	EAccountList *account_list;
 
 	g_return_val_if_fail (GTK_IS_WINDOW (parent), FALSE);
 
@@ -205,7 +206,9 @@
 	gtk_grab_add(emae->editor);
 	gtk_main();
 
-	return mail_config_is_configured();
+	account_list = e_get_account_list ();
+
+	return (e_list_length ((EList *) account_list) > 0);
 }
 
 /**
@@ -224,14 +227,17 @@
 gboolean
 em_utils_check_user_can_send_mail (GtkWindow *parent)
 {
+	EAccountList *account_list;
 	EAccount *account;
 
-	if (!mail_config_is_configured ()) {
+	account_list = e_get_account_list ();
+
+	if (e_list_length ((EList *) account_list) > 0) {
 		if (!em_utils_configure_account (parent))
 			return FALSE;
 	}
 
-	if (!(account = mail_config_get_default_account ()))
+	if (!(account = e_get_default_account ()))
 		return FALSE;
 
 	/* Check for a transport */
@@ -1396,7 +1402,7 @@
 	if (uri == NULL)
 		return FALSE;
 		
-	accounts = mail_config_get_accounts();
+	accounts = e_get_account_list ();
 	iter = e_list_get_iterator ((EList *)accounts);
 	while (e_iterator_is_valid (iter)) {
 		account = (EAccount *)e_iterator_get (iter);
@@ -1447,7 +1453,7 @@
 	if (uri == NULL)
 		return FALSE;
 
-	accounts = mail_config_get_accounts();
+	accounts = e_get_account_list ();
 	iter = e_list_get_iterator((EList *)accounts);
 	while (e_iterator_is_valid(iter)) {
 		account = (EAccount *)e_iterator_get(iter);
@@ -1498,7 +1504,7 @@
 	if (uri == NULL)
 		return FALSE;
 
-	accounts = mail_config_get_accounts();
+	accounts = e_get_account_list ();
 	iter = e_list_get_iterator((EList *)accounts);
 	while (e_iterator_is_valid(iter)) {
 		account = (EAccount *)e_iterator_get(iter);
@@ -1805,7 +1811,7 @@
 	camel_exception_init (&ex);
 
 	/* expunge all remote stores */
-	accounts = mail_config_get_accounts ();
+	accounts = e_get_account_list ();
 	iter = e_list_get_iterator ((EList *) accounts);
 	while (e_iterator_is_valid (iter)) {
 		account = (EAccount *) e_iterator_get (iter);
@@ -1974,7 +1980,7 @@
 		uid = g_strdup(eurl->host);
 	}
 
-	accounts = mail_config_get_accounts();
+	accounts = e_get_account_list ();
 	account = e_account_list_find(accounts, E_ACCOUNT_FIND_UID, uid);
 	g_free(uid);
 
@@ -2417,7 +2423,7 @@
 {
 	EAccountList *accounts;
 
-	accounts = mail_config_get_accounts ();
+	accounts = e_get_account_list ();
 	if (accounts) {
 		EIterator *iter;
 

Modified: branches/kill-bonobo/mail/mail-component.c
==============================================================================
--- branches/kill-bonobo/mail/mail-component.c	(original)
+++ branches/kill-bonobo/mail/mail-component.c	Mon Jan 26 22:18:58 2009
@@ -484,11 +484,14 @@
 impl_quit(PortableServer_Servant servant, CORBA_Environment *ev)
 {
 	MailComponent *mc = MAIL_COMPONENT(bonobo_object_from_servant(servant));
+	EAccountList *account_list;
 
 	if (mc->priv->quit_state == -1)
 		mc->priv->quit_state = MC_QUIT_START;
 
-	mail_config_prune_proxies ();
+	account_list = e_get_account_list ();
+	e_account_list_prune_proxies (account_list);
+
 	switch (mc->priv->quit_state) {
 	case MC_QUIT_START: {
 		extern int camel_application_is_exiting;

Modified: branches/kill-bonobo/mail/mail-config.c
==============================================================================
--- branches/kill-bonobo/mail/mail-config.c	(original)
+++ branches/kill-bonobo/mail/mail-config.c	Mon Jan 26 22:18:58 2009
@@ -53,10 +53,13 @@
 #include <e-util/e-util.h>
 #include <misc/e-gui-utils.h>
 #include "e-util/e-util-labels.h"
+#include "e-util/e-account-utils.h"
 
-#include <libedataserver/e-account-list.h>
 #include <e-util/e-signature-list.h>
 
+#include "shell/e-shell.h"
+#include "shell/e-shell-settings.h"
+
 #include <camel/camel-service.h>
 #include <camel/camel-stream-mem.h>
 #include <camel/camel-stream-fs.h>
@@ -74,14 +77,12 @@
 
 typedef struct {
 	GConfClient *gconf;
+	EShellSettings *shell_settings;
 
 	gboolean corrupt;
 
 	char *gtkrc;
 
-	EAccountList *accounts;
-	ESignatureList *signatures;
-
 	GSList *labels;
 
 	gboolean address_compress;
@@ -105,18 +106,6 @@
 static guint config_write_timeout = 0;
 
 
-void
-mail_config_save_accounts (void)
-{
-	e_account_list_save (config->accounts);
-}
-
-void
-mail_config_save_signatures (void)
-{
-	e_signature_list_save (config->signatures);
-}
-
 static void
 config_clear_mime_types (void)
 {
@@ -351,13 +340,21 @@
 mail_config_init (void)
 {
 	GConfClientNotifyFunc func;
+	EShellSettings *shell_settings;
+	EShell *shell;
 	const gchar *key;
 
+	g_return_if_fail (E_IS_SHELL_SETTINGS (shell_settings));
+
 	if (config)
 		return;
 
+	shell = e_shell_get_default ();
+	shell_settings = e_shell_get_shell_settings (shell);
+
 	config = g_new0 (MailConfig, 1);
 	config->gconf = gconf_client_get_default ();
+	config->shell_settings = g_object_ref (shell_settings);
 	config->mime_types = g_ptr_array_new ();
 	config->gtkrc = g_build_filename (
 		e_get_user_data_dir (), "mail",
@@ -365,9 +362,6 @@
 
 	mail_config_clear ();
 
-	config->accounts = e_account_list_new (config->gconf);
-	config->signatures = e_signature_list_new (config->gconf);
-
 	gtk_rc_parse (config->gtkrc);
 
 	/* Composer Configuration */
@@ -546,16 +540,6 @@
 	if (!config)
 		return;
 
-	if (config->accounts) {
-		g_object_unref (config->accounts);
-		config->accounts = NULL;
-	}
-
-	if (config->signatures) {
-		g_object_unref (config->signatures);
-		config->signatures = NULL;
-	}
-
 	config_clear_labels ();
 	config_clear_mime_types ();
 }
@@ -564,18 +548,30 @@
 void
 mail_config_write (void)
 {
+	EAccountList *account_list;
+	ESignatureList *signature_list;
+
 	if (!config)
 		return;
 
-	e_account_list_save (config->accounts);
-	e_signature_list_save (config->signatures);
+	account_list = e_shell_settings_get_object (
+		config->shell_settings, "accounts");
+	signature_list = e_shell_settings_get_object (
+		config->shell_settings, "signatures");
+
+	e_account_list_save (account_list);
+	e_signature_list_save (signature_list);
 
 	gconf_client_suggest_sync (config->gconf, NULL);
+
+	g_object_unref (account_list);
+	g_object_unref (signature_list);
 }
 
 void
 mail_config_write_on_exit (void)
 {
+	EAccountList *account_list;
 	EAccount *account;
 	EIterator *iter;
 
@@ -589,7 +585,8 @@
 
 	/* then we make sure the ones we want to remember are in the
            session cache */
-	iter = e_list_get_iterator ((EList *) config->accounts);
+	account_list = e_get_account_list ();
+	iter = e_list_get_iterator ((EList *) account_list);
 	while (e_iterator_is_valid (iter)) {
 		char *passwd;
 
@@ -618,7 +615,7 @@
 	e_passwords_clear_passwords ("Mail");
 
 	/* then we remember them */
-	iter = e_list_get_iterator ((EList *) config->accounts);
+	iter = e_list_get_iterator ((EList *) account_list);
 	while (e_iterator_is_valid (iter)) {
 		account = (EAccount *) e_iterator_get (iter);
 
@@ -653,12 +650,6 @@
 }
 
 gboolean
-mail_config_is_configured (void)
-{
-	return e_list_length ((EList *) config->accounts) > 0;
-}
-
-gboolean
 mail_config_is_corrupt (void)
 {
 	return config->corrupt;
@@ -749,53 +740,6 @@
 	return (const char **) config->mime_types->pdata;
 }
 
-gboolean
-mail_config_find_account (EAccount *account)
-{
-	EAccount *acnt;
-	EIterator *iter;
-
-	iter = e_list_get_iterator ((EList *) config->accounts);
-	while (e_iterator_is_valid (iter)) {
-		acnt = (EAccount *) e_iterator_get (iter);
-		if (acnt == account) {
-			g_object_unref (iter);
-			return TRUE;
-		}
-
-		e_iterator_next (iter);
-	}
-
-	g_object_unref (iter);
-
-	return FALSE;
-}
-
-EAccount *
-mail_config_get_default_account (void)
-{
-	if (config == NULL)
-		mail_config_init ();
-
-	if (!config->accounts)
-		return NULL;
-
-	/* should probably return const */
-	return (EAccount *)e_account_list_get_default(config->accounts);
-}
-
-EAccount *
-mail_config_get_account_by_name (const char *account_name)
-{
-	return (EAccount *)e_account_list_find(config->accounts, E_ACCOUNT_FIND_NAME, account_name);
-}
-
-EAccount *
-mail_config_get_account_by_uid (const char *uid)
-{
-	return (EAccount *) e_account_list_find (config->accounts, E_ACCOUNT_FIND_UID, uid);
-}
-
 static gboolean
 mail_config_account_url_equal (const CamelURL *u1,
                                const CamelURL *u2)
@@ -818,6 +762,7 @@
 EAccount *
 mail_config_get_account_by_source_url (const char *source_url)
 {
+	EAccountList *account_list;
 	EAccount *account = NULL;
 	EIterator *iter;
 	CamelURL *url;
@@ -827,7 +772,8 @@
 	url = camel_url_new (source_url, NULL);
 	g_return_val_if_fail (url != NULL, NULL);
 
-	iter = e_list_get_iterator ((EList *) config->accounts);
+	account_list = e_get_account_list ();
+	iter = e_list_get_iterator ((EList *) account_list);
 	while (account == NULL && e_iterator_is_valid (iter)) {
 		CamelURL *account_url;
 
@@ -862,6 +808,7 @@
 EAccount *
 mail_config_get_account_by_transport_url (const char *transport_url)
 {
+	EAccountList *account_list;
 	EAccount *account = NULL;
 	EIterator *iter;
 	CamelURL *url;
@@ -871,7 +818,8 @@
 	url = camel_url_new (transport_url, NULL);
 	g_return_val_if_fail (url != NULL, NULL);
 
-	iter = e_list_get_iterator ((EList *) config->accounts);
+	account_list = e_get_account_list ();
+	iter = e_list_get_iterator ((EList *) account_list);
 	while (account == NULL && e_iterator_is_valid (iter)) {
 		CamelURL *account_url;
 
@@ -903,77 +851,21 @@
 	return account;
 }
 
-int
-mail_config_has_proxies (EAccount *account)
-{
-	return e_account_list_account_has_proxies (config->accounts, account);
-}
-
-void
-mail_config_remove_account_proxies (EAccount *account)
-{
-	e_account_list_remove_account_proxies (config->accounts, account);
-}
-
-void
-mail_config_prune_proxies (void)
-{
-	e_account_list_prune_proxies (config->accounts);
-}
-
-EAccountList *
-mail_config_get_accounts (void)
-{
-	if (config == NULL)
-		mail_config_init ();
-
-	return config->accounts;
-}
-
-void
-mail_config_add_account (EAccount *account)
-{
-	e_account_list_add(config->accounts, account);
-	mail_config_save_accounts ();
-}
-
-void
-mail_config_remove_account (EAccount *account)
-{
-	e_account_list_remove(config->accounts, account);
-	mail_config_save_accounts ();
-}
-
-void
-mail_config_set_default_account (EAccount *account)
-{
-	e_account_list_set_default(config->accounts, account);
-}
-
-EAccountIdentity *
-mail_config_get_default_identity (void)
-{
-	EAccount *account;
-
-	account = mail_config_get_default_account ();
-	if (account)
-		return account->id;
-	else
-		return NULL;
-}
-
 EAccountService *
 mail_config_get_default_transport (void)
 {
+	EAccountList *account_list;
 	EAccount *account;
 	EIterator *iter;
 
-	account = mail_config_get_default_account ();
+	account_list = e_get_account_list ();
+	account = e_get_default_account ();
+
 	if (account && account->enabled && account->transport && account->transport->url && account->transport->url[0])
 		return account->transport;
 
 	/* return the first account with a transport? */
-	iter = e_list_get_iterator ((EList *) config->accounts);
+	iter = e_list_get_iterator ((EList *) account_list);
 	while (e_iterator_is_valid (iter)) {
 		account = (EAccount *) e_iterator_get (iter);
 
@@ -1014,6 +906,7 @@
 void
 mail_config_uri_renamed (GCompareFunc uri_cmp, const char *old, const char *new)
 {
+	EAccountList *account_list;
 	EAccount *account;
 	EIterator *iter;
 	int i, work = 0;
@@ -1025,7 +918,8 @@
 			       "*views/custom_view-",
 			       NULL };
 
-	iter = e_list_get_iterator ((EList *) config->accounts);
+	account_list = e_get_account_list ();
+	iter = e_list_get_iterator ((EList *) account_list);
 	while (e_iterator_is_valid (iter)) {
 		account = (EAccount *) e_iterator_get (iter);
 
@@ -1066,6 +960,7 @@
 void
 mail_config_uri_deleted (GCompareFunc uri_cmp, const char *uri)
 {
+	EAccountList *account_list;
 	EAccount *account;
 	EIterator *iter;
 	int work = 0;
@@ -1078,7 +973,8 @@
 	local_sent_folder_uri = e_mail_shell_module_get_folder_uri (
 		mail_shell_module, E_MAIL_FOLDER_SENT);
 
-	iter = e_list_get_iterator ((EList *) config->accounts);
+	account_list = e_get_account_list ();
+	iter = e_list_get_iterator ((EList *) account_list);
 	while (e_iterator_is_valid (iter)) {
 		account = (EAccount *) e_iterator_get (iter);
 
@@ -1136,12 +1032,6 @@
 	return filename;
 }
 
-ESignatureList *
-mail_config_get_signatures (void)
-{
-	return config->signatures;
-}
-
 static char *
 get_new_signature_filename (void)
 {
@@ -1202,35 +1092,6 @@
 	return sig;
 }
 
-ESignature *
-mail_config_get_signature_by_uid (const char *uid)
-{
-	return (ESignature *) e_signature_list_find (config->signatures, E_SIGNATURE_FIND_UID, uid);
-}
-
-ESignature *
-mail_config_get_signature_by_name (const char *name)
-{
-	return (ESignature *) e_signature_list_find (config->signatures, E_SIGNATURE_FIND_NAME, name);
-}
-
-void
-mail_config_add_signature (ESignature *signature)
-{
-	e_signature_list_add (config->signatures, signature);
-	mail_config_save_signatures ();
-}
-
-void
-mail_config_remove_signature (ESignature *signature)
-{
-	if (signature->filename && !signature->script)
-		g_unlink (signature->filename);
-
-	e_signature_list_remove (config->signatures, signature);
-	mail_config_save_signatures ();
-}
-
 void
 mail_config_reload_junk_headers (void)
 {

Modified: branches/kill-bonobo/mail/mail-config.h
==============================================================================
--- branches/kill-bonobo/mail/mail-config.h	(original)
+++ branches/kill-bonobo/mail/mail-config.h	Mon Jan 26 22:18:58 2009
@@ -26,7 +26,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#include "camel/camel-provider.h" /* can't forward-declare enums, bah */
+#include <camel/camel-provider.h>
 
 struct _EAccount;
 struct _EAccountList;
@@ -96,7 +96,6 @@
 struct _GConfClient *mail_config_get_gconf_client (void);
 
 /* General Accessor functions */
-gboolean mail_config_is_configured            (void);
 gboolean mail_config_is_corrupt               (void);
 
 GSList *mail_config_get_labels (void);
@@ -106,40 +105,17 @@
 void mail_config_service_set_save_passwd (struct _EAccountService *service, gboolean save_passwd);
 
 /* accounts */
-gboolean mail_config_find_account (struct _EAccount *account);
-struct _EAccount *mail_config_get_default_account (void);
-struct _EAccount *mail_config_get_account_by_name (const char *account_name);
-struct _EAccount *mail_config_get_account_by_uid (const char *uid);
 struct _EAccount *mail_config_get_account_by_source_url (const char *url);
 struct _EAccount *mail_config_get_account_by_transport_url (const char *url);
 
-struct _EAccountList *mail_config_get_accounts (void);
-void mail_config_add_account (struct _EAccount *account);
-void mail_config_remove_account (struct _EAccount *account);
-void mail_config_set_default_account (struct _EAccount *account);
 int mail_config_get_address_count (void);
 int mail_config_get_message_limit (void);
 gboolean mail_config_get_enable_magic_spacebar (void);
 
-void mail_config_remove_account_proxies (struct _EAccount *account);
-void mail_config_prune_proxies (void);
-int mail_config_has_proxies (struct _EAccount *account);
-
-struct _EAccountIdentity *mail_config_get_default_identity (void);
 struct _EAccountService  *mail_config_get_default_transport (void);
 
-void mail_config_save_accounts (void);
-
 /* signatures */
 struct _ESignature *mail_config_signature_new (const char *filename, gboolean script, gboolean html);
-struct _ESignature *mail_config_get_signature_by_uid (const char *uid);
-struct _ESignature *mail_config_get_signature_by_name (const char *name);
-
-struct _ESignatureList *mail_config_get_signatures (void);
-void mail_config_add_signature (struct _ESignature *signature);
-void mail_config_remove_signature (struct _ESignature *signature);
-
-void mail_config_save_signatures (void);
 
 char *mail_config_signature_run_script (const char *script);
 

Modified: branches/kill-bonobo/mail/mail-ops.c
==============================================================================
--- branches/kill-bonobo/mail/mail-ops.c	(original)
+++ branches/kill-bonobo/mail/mail-ops.c	Mon Jan 26 22:18:58 2009
@@ -58,6 +58,7 @@
 
 #include <libedataserver/e-data-server-util.h>
 #include "e-util/e-util.h"
+#include "e-util/e-account-utils.h"
 #include "e-util/e-util-private.h"
 
 #include "em-filter-rule.h"
@@ -475,9 +476,9 @@
 		char *name;
 
 		name = g_strstrip(g_strdup(tmp));
-		if ((account = mail_config_get_account_by_uid(name))
+		if ((account = e_get_account_by_uid (name))
 		    /* 'old' x-evolution-account stored the name, how silly */
-		    || (account = mail_config_get_account_by_name(name))) {
+		    || (account = e_get_account_by_name (name))) {
 			if (account->transport && account->transport->url)
 				transport_url = g_strdup (account->transport->url);
 

Modified: branches/kill-bonobo/mail/mail-send-recv.c
==============================================================================
--- branches/kill-bonobo/mail/mail-send-recv.c	(original)
+++ branches/kill-bonobo/mail/mail-send-recv.c	Mon Jan 26 22:18:58 2009
@@ -45,7 +45,9 @@
 #include "mail-send-recv.h"
 #include "mail-folder-cache.h"
 #include "em-event.h"
-#include <e-util/gconf-bridge.h>
+
+#include "e-util/e-account-utils.h"
+#include "e-util/gconf-bridge.h"
 
 #include "e-mail-shell-module.h"
 
@@ -931,11 +933,11 @@
 	if (!camel_session_is_online (session))
 		return send_recv_dialog;
 
-	account = mail_config_get_default_account ();
+	account = e_get_default_account ();
 	if (!account || !account->transport->url)
 		return send_recv_dialog;
 
-	accounts = mail_config_get_accounts ();
+	accounts = e_get_account_list ();
 
 	outbox_folder = e_mail_shell_module_get_folder (
 		mail_shell_module, E_MAIL_FOLDER_OUTBOX);
@@ -1076,7 +1078,7 @@
 	if (!GPOINTER_TO_INT(ed))
 		return;
 
-	accounts = mail_config_get_accounts ();
+	accounts = e_get_account_list ();
 	for (iter = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(iter);e_iterator_next(iter)) {
 		info  = g_object_get_data((GObject *)e_iterator_get(iter), "mail-autoreceive");
 		if (info && info->timeout_id)
@@ -1095,7 +1097,7 @@
 	if (auto_active)
 		return;
 
-	accounts = mail_config_get_accounts ();
+	accounts = e_get_account_list ();
 	auto_active = g_hash_table_new(g_str_hash, g_str_equal);
 
 	g_signal_connect(accounts, "account-added", G_CALLBACK(auto_account_added), NULL);

Modified: branches/kill-bonobo/mail/mail-signature-editor.c
==============================================================================
--- branches/kill-bonobo/mail/mail-signature-editor.c	(original)
+++ branches/kill-bonobo/mail/mail-signature-editor.c	Mon Jan 26 22:18:58 2009
@@ -27,7 +27,7 @@
 #include <glib/gi18n.h>
 
 #include <e-util/e-error.h>
-#include <e-util/e-signature-list.h>
+#include <e-util/e-signature-utils.h>
 #include <composer/e-msg-composer.h>
 
 #include "mail-config.h"
@@ -147,7 +147,7 @@
 		return;
 	}
 
-	signature_list = mail_config_get_signatures ();
+	signature_list = e_get_signature_list ();
 
 	signature_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
 	g_strstrip (signature_name);
@@ -181,8 +181,10 @@
 
 	if (editor->priv->signature != NULL)
 		e_signature_list_change (signature_list, signature);
-	else
-		mail_config_add_signature (signature);
+	else {
+		e_signature_list_add (signature_list, signature);
+		e_signature_list_save (signature_list);
+	}
 
 	gtk_widget_destroy (GTK_WIDGET (editor));
 }

Modified: branches/kill-bonobo/mail/mail-vfolder.c
==============================================================================
--- branches/kill-bonobo/mail/mail-vfolder.c	(original)
+++ branches/kill-bonobo/mail/mail-vfolder.c	Mon Jan 26 22:18:58 2009
@@ -35,6 +35,7 @@
 
 #include "e-util/e-error.h"
 #include "e-util/e-util-private.h"
+#include "e-util/e-account-utils.h"
 
 #include "em-folder-tree-model.h"
 #include "em-utils.h"
@@ -231,7 +232,7 @@
 				else
 					uid = g_strdup_printf("%s %s", url->user, url->host);
 
-				account = e_account_list_find(mail_config_get_accounts(), E_ACCOUNT_FIND_UID, uid);
+				account = e_get_account_by_uid (uid);
 				g_free(uid);
 				if (account != NULL)
 					loc = account->name;
@@ -373,7 +374,7 @@
 	if (found)
 		return found;
 
-	accounts = mail_config_get_accounts ();
+	accounts = e_get_account_list ();
 	iter = e_list_get_iterator ((EList *) accounts);
 	while (e_iterator_is_valid (iter)) {
 		char *curi;

Modified: branches/kill-bonobo/plugins/groupwise-features/proxy-login.c
==============================================================================
--- branches/kill-bonobo/plugins/groupwise-features/proxy-login.c	(original)
+++ branches/kill-bonobo/plugins/groupwise-features/proxy-login.c	Mon Jan 26 22:18:58 2009
@@ -43,6 +43,7 @@
 #include <e-util/e-error.h>
 #include <e-util/e-icon-factory.h>
 #include <e-util/e-util-private.h>
+#include <e-util/e-account-utils.h>
 
 #include <e-gw-container.h>
 #include <e-gw-connection.h>
@@ -302,7 +303,7 @@
 static void
 proxy_soap_login (char *email)
 {
-	EAccountList *accounts = mail_config_get_accounts();
+	EAccountList *accounts = e_get_account_list ();
 	EAccount *srcAccount;
 	EAccount *dstAccount;
 	EGwConnection *proxy_cnc, *cnc;

Modified: branches/kill-bonobo/plugins/imap-features/imap-headers.c
==============================================================================
--- branches/kill-bonobo/plugins/imap-features/imap-headers.c	(original)
+++ branches/kill-bonobo/plugins/imap-features/imap-headers.c	Mon Jan 26 22:18:58 2009
@@ -31,8 +31,7 @@
 
 #include <gtk/gtk.h>
 
-#include <libedataserver/e-account.h>
-#include <libedataserver/e-account-list.h>
+#include "e-util/e-account-utils.h"
 
 #include <camel/camel-url.h>
 #include <camel/camel-exception.h>
@@ -84,7 +83,7 @@
 	if (g_str_has_prefix (account->source->url, "imap://") ||
 			(use_imap && g_str_has_prefix (account->source->url, "groupwise://"))) {
 		EAccount *temp = NULL;
-		EAccountList *accounts = mail_config_get_accounts ();
+		EAccountList *accounts = e_get_account_list ();
 		CamelURL *url = NULL;
 		CamelException ex;
 		GtkTreeModel *model;

Modified: branches/kill-bonobo/shell/e-shell-settings.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-settings.h	(original)
+++ branches/kill-bonobo/shell/e-shell-settings.h	Mon Jan 26 22:18:58 2009
@@ -78,6 +78,7 @@
 						 const gchar *gconf_key);
 
 /* Getters and setters for common EShellSettings property types.
+ * These are more convenient than g_object_get() / g_object_set().
  * Add more types as needed.  If GObject ever adds similar functions,
  * kill these. */
 
@@ -96,6 +97,11 @@
 void		e_shell_settings_set_string	(EShellSettings *shell_settings,
 						 const gchar *property_name,
 						 const gchar *v_string);
+gpointer	e_shell_settings_get_object	(EShellSettings *shell_settings,
+						 const gchar *property_name);
+void		e_shell_settings_set_object	(EShellSettings *shell_settings,
+						 const gchar *property_name,
+						 gpointer v_object);
 
 G_END_DECLS
 



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