[evolution-ews/account-mgmt] Implement prepare_mail().



commit ba183594660bdc752c2e11eb4a8e82d94ab08084
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed May 30 08:08:04 2012 -0400

    Implement prepare_mail().

 src/modules/module-ews-backend.c |   45 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/src/modules/module-ews-backend.c b/src/modules/module-ews-backend.c
index 6fdb342..1a5207e 100644
--- a/src/modules/module-ews-backend.c
+++ b/src/modules/module-ews-backend.c
@@ -787,6 +787,50 @@ e_ews_backend_init (EEwsBackend *backend)
 }
 
 static void
+ews_backend_prepare_mail_account_source (ESource *source)
+{
+	ESourceBackend *extension;
+	const gchar *extension_name;
+
+	extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT;
+	extension = e_source_get_extension (source, extension_name);
+	e_source_backend_set_backend_name (extension, "ews");
+}
+
+static void
+ews_backend_prepare_mail_transport_source (ESource *source)
+{
+	ESourceBackend *extension;
+	const gchar *extension_name;
+
+	extension_name = E_SOURCE_EXTENSION_MAIL_TRANSPORT;
+	extension = e_source_get_extension (source, extension_name);
+	e_source_backend_set_backend_name (extension, "ews");
+}
+
+static void
+ews_backend_factory_prepare_mail (ECollectionBackendFactory *factory,
+                                  ESource *mail_account_source,
+                                  ESource *mail_identity_source,
+                                  ESource *mail_transport_source)
+{
+	ECollectionBackendFactoryClass *parent_class;
+
+	/* Chain up to parent's prepare_mail() method. */
+	parent_class =
+		E_COLLECTION_BACKEND_FACTORY_CLASS (
+		e_ews_backend_factory_parent_class);
+	parent_class->prepare_mail (
+		factory,
+		mail_account_source,
+		mail_identity_source,
+		mail_transport_source);
+
+	ews_backend_prepare_mail_account_source (mail_account_source);
+	ews_backend_prepare_mail_transport_source (mail_transport_source);
+}
+
+static void
 e_ews_backend_factory_class_init (EEwsBackendFactoryClass *class)
 {
 	ECollectionBackendFactoryClass *factory_class;
@@ -794,6 +838,7 @@ e_ews_backend_factory_class_init (EEwsBackendFactoryClass *class)
 	factory_class = E_COLLECTION_BACKEND_FACTORY_CLASS (class);
 	factory_class->factory_name = "ews";
 	factory_class->backend_type = E_TYPE_EWS_BACKEND;
+	factory_class->prepare_mail = ews_backend_factory_prepare_mail;
 }
 
 static void



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