[evolution-exchange] Bug 590251 - Fails to build against eds-dbus



commit 10ea5b8144ba5a5f34a13e0fec450437d4aeb63f
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Aug 24 10:14:07 2009 -0400

    Bug 590251 - Fails to build against eds-dbus

 addressbook/Makefile.am                            |   10 +-
 addressbook/e-book-backend-exchange-factory.c      |   82 +++++++++-----
 addressbook/e-book-backend-exchange-factory.h      |   41 +++++--
 addressbook/e-book-backend-exchange.c              |    4 +-
 addressbook/e-book-backend-gal.c                   |    5 +-
 calendar/Makefile.am                               |    9 +-
 calendar/e-cal-backend-exchange-factory.c          |  119 ++++++++++++--------
 calendar/e-cal-backend-exchange-factory.h          |   65 +++++++++--
 camel/Makefile.am                                  |    7 +-
 configure.ac                                       |    3 +
 .../GNOME_Evolution_Exchange_Storage.server.in.in  |   36 ------
 storage/Makefile.am                                |   11 +-
 storage/exchange-component.c                       |   37 ------
 storage/exchange-component.h                       |    6 -
 storage/main.c                                     |  103 -----------------
 15 files changed, 235 insertions(+), 303 deletions(-)
---
diff --git a/addressbook/Makefile.am b/addressbook/Makefile.am
index 8be9066..66af3ca 100644
--- a/addressbook/Makefile.am
+++ b/addressbook/Makefile.am
@@ -38,9 +38,9 @@ else
 	fi
 endif
 
-noinst_LTLIBRARIES = libexchangeaddressbook.la
+extension_LTLIBRARIES = libebookbackendexchange.la
 
-libexchangeaddressbook_la_SOURCES = \
+libebookbackendexchange_la_SOURCES = \
 	e-book-backend-exchange.c \
 	e-book-backend-exchange.h \
 	e-book-backend-exchange-factory.c \
@@ -51,14 +51,14 @@ libexchangeaddressbook_la_SOURCES = \
 	e-book-backend-gal.h
 
 if HAVE_LIBDB
-libexchangeaddressbook_la_SOURCES += \
+libebookbackendexchange_la_SOURCES += \
 	e-book-backend-db-cache.c \
 	e-book-backend-db-cache.h
 
-libexchangeaddressbook_la_LIBADD =  \
+libebookbackendexchange_la_LIBADD =  \
 	$(DB_LIBS)
 
-libexchangeaddressbook_la_LDFLAGS = \
+libebookbackendexchange_la_LDFLAGS = \
 	-module -avoid-version $(NO_UNDEFINED)
 endif
 
diff --git a/addressbook/e-book-backend-exchange-factory.c b/addressbook/e-book-backend-exchange-factory.c
index 3b8716a..c045ecc 100644
--- a/addressbook/e-book-backend-exchange-factory.c
+++ b/addressbook/e-book-backend-exchange-factory.c
@@ -24,53 +24,79 @@
 #include <pthread.h>
 #include <string.h>
 
+#include <libebackend/e-data-server-module.h>
 #include "e-book-backend-exchange-factory.h"
 #include "e-book-backend-exchange.h"
 
-static void
-e_book_backend_exchange_factory_instance_init (EBookBackendExchangeFactory *factory)
-{
-}
+static GType exchange_type;
 
 static const gchar *
-_get_protocol (EBookBackendFactory *factory)
+book_backend_exchange_factory_get_protocol (EBookBackendFactory *factory)
 {
 	return "exchange";
 }
 
 static EBookBackend*
-_new_backend (EBookBackendFactory *factory)
+book_backend_exchange_factory_new_backend (EBookBackendFactory *factory)
 {
 	return e_book_backend_exchange_new ();
 }
 
 static void
-e_book_backend_exchange_factory_class_init (EBookBackendExchangeFactoryClass *klass)
+book_backend_exchange_factory_class_init (EBookBackendExchangeFactoryClass *class)
 {
-  E_BOOK_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-  E_BOOK_BACKEND_FACTORY_CLASS (klass)->new_backend = _new_backend;
+	EBookBackendFactoryClass *factory_class;
+
+	factory_class = E_BOOK_BACKEND_FACTORY_CLASS (class);
+	factory_class->get_protocol = book_backend_exchange_factory_get_protocol;
+	factory_class->new_backend = book_backend_exchange_factory_new_backend;
 }
 
 GType
 e_book_backend_exchange_factory_get_type (void)
 {
-	static GType  type = 0;
-
-	if (!type) {
-		GTypeInfo info = {
-			sizeof (EBookBackendExchangeFactoryClass),
-			NULL, /* base_class_init */
-			NULL, /* base_class_finalize */
-			(GClassInitFunc)  e_book_backend_exchange_factory_class_init,
-			NULL, /* class_finalize */
-			NULL, /* class_data */
-			sizeof (EBookBackend),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) e_book_backend_exchange_factory_instance_init
-		};
-
-		type = g_type_register_static (E_TYPE_BOOK_BACKEND_FACTORY,
-					       "EBookBackendExchangeFactory", &info, 0);
-	}
-	return type;
+	return exchange_type;
+}
+
+void
+e_book_backend_exchange_factory_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (EBookBackendExchangeFactoryClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc)  book_backend_exchange_factory_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EBookBackend),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) NULL,
+		NULL   /* value_table */
+	};
+
+	exchange_type = g_type_module_register_type (
+		type_module, E_TYPE_BOOK_BACKEND_FACTORY,
+		"EBookBackendExchangeFactory", &type_info, 0);
+}
+
+void
+eds_module_initialize (GTypeModule *type_module)
+{
+	e_book_backend_exchange_factory_register_type (type_module);
+}
+
+void
+eds_module_shutdown (void)
+{
+}
+
+void
+eds_module_list_types (const GType **types, gint *num_types)
+{
+	static GType module_types[1];
+
+	module_types[0] = E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY;
+
+	*types = module_types;
+	*num_types = G_N_ELEMENTS (module_types);
 }
diff --git a/addressbook/e-book-backend-exchange-factory.h b/addressbook/e-book-backend-exchange-factory.h
index 5ef97a4..8a56d64 100644
--- a/addressbook/e-book-backend-exchange-factory.h
+++ b/addressbook/e-book-backend-exchange-factory.h
@@ -26,24 +26,41 @@
 #include <glib-object.h>
 #include <libedata-book/e-book-backend-factory.h>
 
+/* Standard GObject macros */
+#define E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY \
+	(e_book_backend_exchange_factory_get_type ())
+#define E_BOOK_BACKEND_EXCHANGE_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactory))
+#define E_BOOK_BACKEND_EXCHANGE_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactoryClass))
+#define E_IS_BOOK_BACKEND_EXCHANGE_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY))
+#define E_IS_BOOK_BACKEND_EXCHANGE_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY))
+#define E_BOOK_BACKEND_EXCHANGE_FACTORY_GET_CLASS(cls) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactoryClass))
+
 G_BEGIN_DECLS
 
-#define E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY        (e_book_backend_exchange_factory_get_type ())
-#define E_BOOK_BACKEND_EXCHANGE_FACTORY(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactory))
-#define E_BOOK_BACKEND_EXCHANGE_FACTORY_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactoryClass))
-#define E_IS_BOOK_BACKEND_EXCHANGE_FACTORY(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY))
-#define E_IS_BOOK_BACKEND_EXCHANGE_FACTORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY))
-#define E_BOOK_BACKEND_EXCHANGE_FACTORY_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactoryClass))
+typedef struct _EBookBackendExchangeFactory EBookBackendExchangeFactory;
+typedef struct _EBookBackendExchangeFactoryClass EBookBackendExchangeFactoryClass;
 
-typedef struct {
-	EBookBackendFactory            parent_object;
-} EBookBackendExchangeFactory;
+struct _EBookBackendExchangeFactory {
+	EBookBackendFactory parent;
+};
 
-typedef struct {
+struct _EBookBackendExchangeFactoryClass {
 	EBookBackendFactoryClass parent_class;
-} EBookBackendExchangeFactoryClass;
+};
 
-GType	e_book_backend_exchange_factory_get_type (void);
+GType		e_book_backend_exchange_factory_get_type (void);
+void		e_book_backend_exchange_factory_register_type
+						(GTypeModule *type_module);
 
 G_END_DECLS
 
diff --git a/addressbook/e-book-backend-exchange.c b/addressbook/e-book-backend-exchange.c
index 84cb973..1de981b 100644
--- a/addressbook/e-book-backend-exchange.c
+++ b/addressbook/e-book-backend-exchange.c
@@ -33,7 +33,6 @@
 
 #include <libedataserver/e-sexp.h>
 #include <libedataserver/e-uid.h>
-#include <e-util/e-util.h>
 #include <libebook/e-address-western.h>
 #include <libebook/e-contact.h>
 #include <libedata-book/e-data-book.h>
@@ -2846,7 +2845,8 @@ e_book_backend_exchange_construct (EBookBackendExchange *backend)
 }
 
 static void
-e_book_backend_exchange_set_mode (EBookBackend *backend, gint mode)
+e_book_backend_exchange_set_mode (EBookBackend *backend,
+                                  GNOME_Evolution_Addressbook_BookMode mode)
 {
 	EBookBackendExchange *be = E_BOOK_BACKEND_EXCHANGE (backend);
 	EBookBackendExchangePrivate *bepriv = be->priv;
diff --git a/addressbook/e-book-backend-gal.c b/addressbook/e-book-backend-gal.c
index f4d98db..0371a99 100644
--- a/addressbook/e-book-backend-gal.c
+++ b/addressbook/e-book-backend-gal.c
@@ -2451,7 +2451,8 @@ cancel_operation (EBookBackend *backend, EDataBook *book)
 }
 
 static void
-set_mode (EBookBackend *backend, gint mode)
+set_mode (EBookBackend *backend,
+          GNOME_Evolution_Addressbook_BookMode mode)
 {
 	EBookBackendGAL *be = E_BOOK_BACKEND_GAL (backend);
 	EBookBackendGALPrivate *bepriv;
@@ -2856,7 +2857,7 @@ class_init (EBookBackendGALClass *klass)
 	backend_class->get_changes                = get_changes;
 	backend_class->authenticate_user          = authenticate_user;
 	backend_class->get_supported_fields       = get_supported_fields;
-	backend_class->set_mode		  = set_mode;
+	backend_class->set_mode                   = set_mode;
 	backend_class->get_required_fields        = get_required_fields;
 	backend_class->get_supported_auth_methods = get_supported_auth_methods;
 	backend_class->cancel_operation           = cancel_operation;
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 6bb7f64..270cf09 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -6,10 +6,10 @@ AM_CPPFLAGS = \
 	$(LDAP_CFLAGS) \
 	-DG_LOG_DOMAIN=\"e-cal-backend-exchange\"
 
-noinst_LTLIBRARIES = \
-        libexchangecalendar.la
+extension_LTLIBRARIES = \
+        libecalbackendexchange.la
 
-libexchangecalendar_la_SOURCES =  \
+libecalbackendexchange_la_SOURCES = \
 	e-cal-backend-exchange.c \
 	e-cal-backend-exchange.h \
 	e-cal-backend-exchange-calendar.c \
@@ -23,4 +23,7 @@ libexchangecalendar_la_SOURCES =  \
 	e2k-cal-utils.c \
 	e2k-cal-utils.h
 
+libecalbackendexchange_la_LDFLAGS = \
+	-module -avoid-version $(NO_UNDEFINED)
+
 -include $(top_srcdir)/git.mk
diff --git a/calendar/e-cal-backend-exchange-factory.c b/calendar/e-cal-backend-exchange-factory.c
index 3715e7c..62c0de5 100644
--- a/calendar/e-cal-backend-exchange-factory.c
+++ b/calendar/e-cal-backend-exchange-factory.c
@@ -24,14 +24,13 @@
 #include <pthread.h>
 #include <string.h>
 
+#include <libebackend/e-data-server-module.h>
 #include "e-cal-backend-exchange-factory.h"
 #include "e-cal-backend-exchange-calendar.h"
 #include "e-cal-backend-exchange-tasks.h"
 
-static void
-e_cal_backend_exchange_factory_instance_init (ECalBackendExchangeFactory *factory)
-{
-}
+static GType exchange_events_type;
+static GType exchange_todos_type;
 
 static const gchar *
 _get_protocol (ECalBackendFactory *factory)
@@ -84,51 +83,79 @@ events_backend_exchange_factory_class_init (ECalBackendExchangeFactoryClass *kla
 }
 
 GType
-events_backend_exchange_factory_get_type (void)
+e_cal_backend_exchange_events_factory_get_type (void)
+{
+	return exchange_events_type;
+}
+
+void
+e_cal_backend_exchange_events_factory_register_type (GTypeModule *type_module)
 {
-	static GType type = 0;
-
-	if (!type) {
-		GTypeInfo info = {
-			sizeof (ECalBackendExchangeFactoryClass),
-			NULL, /* base_class_init */
-			NULL, /* base_class_finalize */
-			(GClassInitFunc)  events_backend_exchange_factory_class_init,
-			NULL, /* class_finalize */
-			NULL, /* class_data */
-			sizeof (ECalBackend),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) e_cal_backend_exchange_factory_instance_init
-		};
-
-		type = g_type_register_static (E_TYPE_CAL_BACKEND_FACTORY,
-					       "ECalBackendExchangeEventsFactory",
-					       &info, 0);
-	}
-	return type;
+	static const GTypeInfo type_info = {
+		sizeof (ECalBackendExchangeFactoryClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) events_backend_exchange_factory_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ECalBackendExchangeFactory),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) NULL,
+		NULL   /* value_table */
+	};
+
+	exchange_events_type = g_type_module_register_type (
+		type_module, E_TYPE_CAL_BACKEND_FACTORY,
+		"ECalBackendExchangeEventsFactory", &type_info, 0);
 }
 
 GType
-todos_backend_exchange_factory_get_type (void)
+e_cal_backend_exchange_todos_factory_get_type (void)
+{
+	return exchange_todos_type;
+}
+
+void
+e_cal_backend_exchange_todos_factory_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (ECalBackendExchangeFactoryClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc)  todos_backend_exchange_factory_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ECalBackendExchangeFactory),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) NULL,
+		NULL   /* value_table */
+	};
+
+	exchange_todos_type = g_type_module_register_type (
+		type_module, E_TYPE_CAL_BACKEND_FACTORY,
+		"ECalBackendExchangeTodosFactory", &type_info, 0);
+}
+
+void
+eds_module_initialize (GTypeModule *type_module)
+{
+	e_cal_backend_exchange_events_factory_register_type (type_module);
+	e_cal_backend_exchange_todos_factory_register_type (type_module);
+}
+
+void
+eds_module_shutdown (void)
 {
-	static GType type = 0;
-
-	if (!type) {
-		GTypeInfo info = {
-			sizeof (ECalBackendExchangeFactoryClass),
-			NULL, /* base_class_init */
-			NULL, /* base_class_finalize */
-			(GClassInitFunc)  todos_backend_exchange_factory_class_init,
-			NULL, /* class_finalize */
-			NULL, /* class_data */
-			sizeof (ECalBackend),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) e_cal_backend_exchange_factory_instance_init
-		};
-
-		type = g_type_register_static (E_TYPE_CAL_BACKEND_FACTORY,
-					       "ECalBackendExchangeTodosFactory",
-					       &info, 0);
-	}
-	return type;
+}
+
+void
+eds_module_list_types (const GType **types, gint *num_types)
+{
+	static GType module_types[2];
+
+	module_types[0] = E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY;
+	module_types[1] = E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY;
+
+	*types = module_types;
+	*num_types = G_N_ELEMENTS (module_types);
 }
diff --git a/calendar/e-cal-backend-exchange-factory.h b/calendar/e-cal-backend-exchange-factory.h
index 7a1bbcf..609ad0f 100644
--- a/calendar/e-cal-backend-exchange-factory.h
+++ b/calendar/e-cal-backend-exchange-factory.h
@@ -26,25 +26,64 @@
 #include <glib-object.h>
 #include <libedata-cal/e-cal-backend-factory.h>
 
+/* Standard GObject macros */
+#define E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY \
+	(e_cal_backend_exchange_events_factory_get_type ())
+#define E_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY, ECalBackendExchangeFactory))
+#define E_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY, ECalBackendExchangeFactoryClass))
+#define E_IS_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY))
+#define E_IS_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY))
+#define E_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY_GET_CLASS(cls) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY, ECalBackendExchangeFactoryClass))
+
+/* Standard GObject macros */
+#define E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY \
+	(e_cal_backend_exchange_todos_factory_get_type ())
+#define E_CAL_BACKEND_EXCHANGE_TODOS_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY, ECalBackendExchangeFactory))
+#define E_CAL_BACKEND_EXCHANGE_TODOS_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY, ECalBackendExchangeFactoryClass))
+#define E_IS_CAL_BACKEND_EXCHANGE_TODOS_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY))
+#define E_IS_CAL_BACKEND_EXCHANGE_TODOS_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY))
+#define E_CAL_BACKEND_EXCHANGE_TODOS_FACTORY_GET_CLASS(cls) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY, ECalBackendExchangeFactoryClass))
+
 G_BEGIN_DECLS
 
-#define E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY        (e_cal_backend_exchange_factory_get_type ())
-#define E_CAL_BACKEND_EXCHANGE_FACTORY(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY, ECalBackendExchangeFactory))
-#define E_CAL_BACKEND_EXCHANGE_FACTORY_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY, ECalBackendExchangeFactoryClass))
-#define E_IS_CAL_BACKEND_EXCHANGE_FACTORY(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY))
-#define E_IS_CAL_BACKEND_EXCHANGE_FACTORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY))
-#define E_CAL_BACKEND_EXCHANGE_FACTORY_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY, ECalBackendExchangeFactoryClass))
+typedef struct _ECalBackendExchangeFactory ECalBackendExchangeFactory;
+typedef struct _ECalBackendExchangeFactoryClass ECalBackendExchangeFactoryClass;
 
-typedef struct {
-	ECalBackendFactory            parent_object;
-} ECalBackendExchangeFactory;
+struct _ECalBackendExchangeFactory {
+	ECalBackendFactory parent;
+};
 
-typedef struct {
+struct _ECalBackendExchangeFactoryClass {
 	ECalBackendFactoryClass parent_class;
-} ECalBackendExchangeFactoryClass;
+};
+
+GType		e_cal_backend_exchange_events_factory_get_type (void);
+void		e_cal_backend_exchange_events_factory_register_type
+						(GTypeModule *type_module);
 
-GType	events_backend_exchange_factory_get_type (void);
-GType	todos_backend_exchange_factory_get_type (void);
+GType		e_cal_backend_exchange_todos_factory_get_type (void);
+void		e_cal_backend_exchange_todos_factory_register_type
+						(GTypeModule *type_module);
 
 G_END_DECLS
 
diff --git a/camel/Makefile.am b/camel/Makefile.am
index 0195f84..78a82ea 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -13,7 +13,7 @@ AM_CPPFLAGS = \
 	-DCONNECTOR_LOCALEDIR=\"$(localedir)\" \
 	-DG_LOG_DOMAIN=\"camel-exchange-provider\"
 
-libcamelexchange_la_SOURCES =  \
+libcamelexchange_la_SOURCES = \
 	camel-exchange-folder.c \
 	camel-exchange-provider.c \
 	camel-exchange-journal.c \
@@ -35,9 +35,10 @@ noinst_HEADERS = \
 	camel-stub-marshal.h \
 	camel-stub.h
 
-libcamelexchange_la_LDFLAGS = -avoid-version -module $(NO_UNDEFINED)
+libcamelexchange_la_LDFLAGS = \
+	-avoid-version -module $(NO_UNDEFINED)
 
-libcamelexchange_la_LIBADD =  \
+libcamelexchange_la_LIBADD = \
 	$(LDAP_LIBS) \
 	$(LIBEXCHANGE_LIBS) \
 	$(EXCHANGE_STORAGE_LIBS) \
diff --git a/configure.ac b/configure.ac
index 5291123..9258041 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,6 +192,9 @@ if test "x$EXCHANGE_PACKAGE" != "x"; then
 	exit 1
 fi
 
+extensiondir="`pkg-config --variable=extensiondir evolution-data-server-$EDS_API_VERSION`"
+AC_SUBST(extensiondir)
+
 EVOLUTION_idldir="`pkg-config --variable=idldir evolution-shell`"
 AC_SUBST(EVOLUTION_idldir)
 
diff --git a/storage/GNOME_Evolution_Exchange_Storage.server.in.in b/storage/GNOME_Evolution_Exchange_Storage.server.in.in
index 97a2ec0..bf45b93 100644
--- a/storage/GNOME_Evolution_Exchange_Storage.server.in.in
+++ b/storage/GNOME_Evolution_Exchange_Storage.server.in.in
@@ -38,40 +38,4 @@
 -->
 </oaf_server>
 
-<oaf_server iid="OAFIID:GNOME_Evolution_Exchange_Connector_BookFactory:@API_VERSION@"
-            type="exe"
-            location="@CONNECTOR_PATH@/evolution-exchange-storage EXEEXT@">
-
-	<oaf_attribute name="repo_ids" type="stringv">
-		<item value="IDL:GNOME/Evolution/DataServer/BookFactory:@API_VERSION@"/>
-		<item value="IDL:Bonobo/Unknown:1.0"/>
-	</oaf_attribute>
-
-	<oaf_attribute name="name" type="string"
-                       _value="Evolution Addressbook Exchange backend"/>
-
-        <oaf_attribute name="addressbook:supported_protocols" type="stringv">
-		<item value="exchange"/>
-		<item value="gal"/>
-        </oaf_attribute>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Exchange_Connector_CalFactory:@API_VERSION@"
-            type="exe"
-            location="@CONNECTOR_PATH@/evolution-exchange-storage EXEEXT@">
-
-	<oaf_attribute name="repo_ids" type="stringv">
-		<item value="IDL:GNOME/Evolution/DataServer/CalFactory:@API_VERSION@"/>
-		<item value="IDL:Bonobo/Unknown:1.0"/>
-	</oaf_attribute>
-
-        <oaf_attribute name="calendar:supported_protocols" type="stringv">
-		<item value="exchange"/>
-	</oaf_attribute>
-
-	<oaf_attribute name="name" type="string"
-                       _value="Evolution Calendar Exchange backend"/>
-
-</oaf_server>
-
 </oaf_info>
diff --git a/storage/Makefile.am b/storage/Makefile.am
index a483048..7149b92 100644
--- a/storage/Makefile.am
+++ b/storage/Makefile.am
@@ -2,15 +2,14 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir) \
 	-I$(top_srcdir)/mail \
 	-I$(top_srcdir)/camel \
-	-I$(top_srcdir)/calendar \
 	-DG_LOG_DOMAIN=\"evolution-exchange-storage\" \
 	$(LIBEXCHANGE_CFLAGS) \
 	$(EXCHANGE_STORAGE_CFLAGS) \
 	$(LDAP_CFLAGS) \
 	-DPREFIX=\"$(prefix)\" \
-	-DSYSCONFDIR=\""$(sysconfdir)"\"  \
-	-DDATADIR=\""$(datadir)"\"	  \
-	-DLIBDIR=\""$(datadir)"\"	  \
+	-DSYSCONFDIR=\""$(sysconfdir)"\" \
+	-DDATADIR=\""$(datadir)"\" \
+	-DLIBDIR=\""$(datadir)"\" \
 	-DCONNECTOR_IMAGESDIR=\""$(imagesdir)"\" \
 	-DCONNECTOR_UIDIR=\""$(uidir)"\" \
 	-DCONNECTOR_LOCALEDIR=\""$(localedir)\""
@@ -37,8 +36,6 @@ evolution_exchange_storage_SOURCES = \
 
 evolution_exchange_storage_LDADD = \
 	$(top_builddir)/mail/libexchangemail.la  \
-	$(top_builddir)/addressbook/libexchangeaddressbook.la \
-	$(top_builddir)/calendar/libexchangecalendar.la \
 	$(top_builddir)/camel/camel-stub-marshal.lo \
 	$(LDAP_LIBS) \
 	$(EXCHANGE_STORAGE_LIBS) \
@@ -71,7 +68,7 @@ migr_test_SOURCES = \
 	exchange-migrate.c \
 	exchange-migrate.h
 
-migr_test_LDADD =  \
+migr_test_LDADD = \
 	$(LDAP_LIBS) \
 	$(EXCHANGE_STORAGE_LIBS) \
 	$(LIBEXCHANGE_LIBS)
diff --git a/storage/exchange-component.c b/storage/exchange-component.c
index 0bed49f..6721ff0 100644
--- a/storage/exchange-component.c
+++ b/storage/exchange-component.c
@@ -58,9 +58,6 @@ static guint linestatus_signal_id;
 struct ExchangeComponentPrivate {
 	ExchangeConfigListener *config_listener;
 
-	EDataCalFactory *cal_factory;
-	EDataBookFactory *book_factory;
-
 	gboolean linestatus;
 
 	GSList *accounts;
@@ -110,16 +107,6 @@ dispose (GObject *object)
 		priv->views = NULL;
 	}
 
-	if (priv->cal_factory) {
-		g_object_unref (priv->cal_factory);
-		priv->cal_factory = NULL;
-	}
-
-	if (priv->book_factory) {
-		g_object_unref (priv->book_factory);
-		priv->book_factory = NULL;
-	}
-
 	if (priv->evo_listener) {
 		CORBA_Environment ev;
 
@@ -261,16 +248,6 @@ impl_setLineStatus (PortableServer_Servant servant,
 			break;
 	}
 
-	if (priv->cal_factory) {
-		e_data_cal_factory_set_backend_mode (priv->cal_factory,
-						     priv->linestatus ? ONLINE_MODE : OFFLINE_MODE);
-	}
-
-	if (priv->book_factory) {
-		e_data_book_factory_set_backend_mode (priv->book_factory,
-						      priv->linestatus ? ONLINE_MODE : OFFLINE_MODE);
-	}
-
 	if (priv->evo_listener == NULL) {
 		priv->evo_listener = CORBA_Object_duplicate (listener, ev);
 		if (ev->_major == CORBA_NO_EXCEPTION) {
@@ -536,17 +513,3 @@ exchange_component_is_interactive (ExchangeComponent *component)
 	return component->priv->xid != 0;
 }
 */
-
-void
-exchange_component_set_factories (ExchangeComponent *component,
-				  EDataCalFactory *cal_factory,
-				  EDataBookFactory *book_factory)
-{
-	g_return_if_fail (EXCHANGE_IS_COMPONENT (component));
-	g_return_if_fail (E_IS_DATA_CAL_FACTORY (cal_factory));
-	g_return_if_fail (E_IS_DATA_BOOK_FACTORY (book_factory));
-
-	component->priv->cal_factory = g_object_ref (cal_factory);
-	component->priv->book_factory = g_object_ref (book_factory);
-}
-
diff --git a/storage/exchange-component.h b/storage/exchange-component.h
index d0b3ed8..464a6a9 100644
--- a/storage/exchange-component.h
+++ b/storage/exchange-component.h
@@ -47,14 +47,8 @@ ExchangeAccount   *exchange_component_get_account_for_uri (ExchangeComponent *co
 gboolean           exchange_component_is_interactive      (ExchangeComponent *component);
 void           exchange_component_is_offline      (ExchangeComponent *component, gint *state);
 
-void exchange_component_set_factories (ExchangeComponent *component,
-				       EDataCalFactory *cal_factory,
-				       EDataBookFactory *book_factory);
-
 #define EXCHANGE_COMPONENT_FACTORY_IID  "OAFIID:GNOME_Evolution_Exchange_Component_Factory:" BASE_VERSION
 #define EXCHANGE_COMPONENT_IID		"OAFIID:GNOME_Evolution_Exchange_Component:" BASE_VERSION
-#define EXCHANGE_CALENDAR_FACTORY_ID	"OAFIID:GNOME_Evolution_Exchange_Connector_CalFactory:" API_VERSION
-#define EXCHANGE_ADDRESSBOOK_FACTORY_ID	"OAFIID:GNOME_Evolution_Exchange_Connector_BookFactory:" API_VERSION
 #define EXCHANGE_AUTOCONFIG_WIZARD_ID	"OAFIID:GNOME_Evolution_Exchange_Connector_Startup_Wizard:" BASE_VERSION
 
 G_END_DECLS
diff --git a/storage/main.c b/storage/main.c
index 12b29e6..60d2103 100644
--- a/storage/main.c
+++ b/storage/main.c
@@ -48,20 +48,11 @@
 
 #include <e2k-utils.h>
 #include <exchange-constants.h>
-#include "addressbook/e-book-backend-exchange.h"
-#include "addressbook/e-book-backend-exchange-factory.h"
-#include "addressbook/e-book-backend-gal.h"
-#include "addressbook/e-book-backend-gal-factory.h"
-#include "calendar/e-cal-backend-exchange-calendar.h"
-#include "calendar/e-cal-backend-exchange-tasks.h"
-#include "calendar/e-cal-backend-exchange-factory.h"
 
 #include "exchange-autoconfig-wizard.h"
 #include "exchange-component.h"
 
 static BonoboGenericFactory *component_factory = NULL;
-static EDataCalFactory *cal_factory = NULL;
-static EDataBookFactory *book_factory = NULL;
 
 ExchangeComponent *global_exchange_component;
 
@@ -92,92 +83,6 @@ setup_component_factory (void)
 	return TRUE;
 }
 
-static void
-last_calendar_gone_cb (EDataCalFactory *factory, gpointer data)
-{
-	/* FIXME: what to do? */
-}
-
-/* Creates the calendar factory object and registers it */
-static gboolean
-setup_calendar_factory (void)
-{
-	gint mode;
-
-	cal_factory = e_data_cal_factory_new ();
-	if (!cal_factory) {
-		g_message ("setup_calendar_factory(): Could not create the calendar factory");
-		return FALSE;
-	}
-
-	exchange_component_is_offline (global_exchange_component, &mode);
-
-	if (mode == ONLINE_MODE)
-		e_data_cal_factory_set_backend_mode (cal_factory, ONLINE_MODE);
-	else if (mode == OFFLINE_MODE)
-		e_data_cal_factory_set_backend_mode (cal_factory, OFFLINE_MODE);
-
-	e_data_cal_factory_register_backend (cal_factory,
-					     (g_object_new (events_backend_exchange_factory_get_type(),
-							    NULL)));
-
-	e_data_cal_factory_register_backend (cal_factory,
-					     (g_object_new (todos_backend_exchange_factory_get_type(),
-							    NULL)));
-
-	/* register the factory with bonobo */
-	if (!e_data_cal_factory_register_storage (cal_factory, EXCHANGE_CALENDAR_FACTORY_ID)) {
-		bonobo_object_unref (BONOBO_OBJECT (cal_factory));
-		cal_factory = NULL;
-		return FALSE;
-	}
-
-	g_signal_connect (cal_factory, "last_calendar_gone",
-			  G_CALLBACK (last_calendar_gone_cb), NULL);
-	return TRUE;
-}
-
-static void
-last_book_gone_cb (EDataBookFactory *factory, gpointer data)
-{
-        /* FIXME: what to do? */
-}
-
-static gboolean
-setup_addressbook_factory (void)
-{
-	gint mode;
-
-        book_factory = e_data_book_factory_new ();
-        if (!book_factory)
-                return FALSE;
-
-	exchange_component_is_offline (global_exchange_component, &mode);
-
-	if (mode == ONLINE_MODE)
-		e_data_book_factory_set_backend_mode (book_factory, ONLINE_MODE);
-	else if (mode == OFFLINE_MODE)
-		e_data_book_factory_set_backend_mode (book_factory, OFFLINE_MODE);
-
-	e_data_book_factory_register_backend (book_factory,
-					      (g_object_new (e_book_backend_exchange_factory_get_type(),
-							     NULL)));
-	e_data_book_factory_register_backend (book_factory,
-					      (g_object_new (e_book_backend_gal_factory_get_type(),
-							     NULL)));
-
-        g_signal_connect (book_factory, "last_book_gone",
-			  G_CALLBACK (last_book_gone_cb), NULL);
-
-        if (!e_data_book_factory_activate (book_factory, EXCHANGE_ADDRESSBOOK_FACTORY_ID)) {
-                bonobo_object_unref (BONOBO_OBJECT (book_factory));
-                book_factory = NULL;
-                return FALSE;
-        }
-
-        return TRUE;
-}
-
 gint
 main (gint argc, gchar **argv)
 {
@@ -255,14 +160,6 @@ main (gint argc, gchar **argv)
 	/* register factories */
 	if (!setup_component_factory ())
 		goto failed;
-	if (!setup_calendar_factory ())
-		goto failed;
-        if (!setup_addressbook_factory ())
-		goto failed;
-
-	exchange_component_set_factories (global_exchange_component,
-					  cal_factory,
-					  book_factory);
 
 	fprintf (stderr, "Evolution Exchange Storage up and running\n");
 #ifdef E2K_DEBUG



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