[evolution-data-server] Remove the addressbook support from the ORBit server



commit eea09626dbaabb0fd2094134e634220e63289f74
Author: Ross Burton <ross linux intel com>
Date:   Mon Jun 22 08:11:25 2009 +0100

    Remove the addressbook support from the ORBit server

 src/Makefile.am        |    3 --
 src/offline-listener.c |   21 +----------
 src/offline-listener.h |    9 +----
 src/server.c           |   91 +++---------------------------------------------
 4 files changed, 8 insertions(+), 116 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 2d62972..5d8ce03 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,8 +5,6 @@ AM_CPPFLAGS =						\
 	-DDATADIR=\"$(datadir)\"			\
 	-DLIBDIR=\"$(libdir)\"				\
 	-I$(top_srcdir)					\
-	-I$(top_srcdir)/addressbook			\
-	-I$(top_builddir)/addressbook			\
 	-I$(top_srcdir)/calendar			\
 	-I$(top_srcdir)/calendar			\
 	-I$(top_builddir)/calendar			\
@@ -55,7 +53,6 @@ endif
 evolution_data_server_LDADD =                                           \
 	$(top_builddir)/libebackend/libebackend-1.2.la                  \
 	$(top_builddir)/libedataserver/libedataserver-1.2.la            \
-	$(top_builddir)/addressbook/libedata-book/libedata-book-1.2.la  \
 	$(E_DATA_CAL_LIBS)                                              \
 	$(E_FACTORY_LIBS)                                               \
 	$(E_DATA_SERVER_LIBS)
diff --git a/src/offline-listener.c b/src/offline-listener.c
index 32f03de..05d6881 100644
--- a/src/offline-listener.c
+++ b/src/offline-listener.c
@@ -25,10 +25,7 @@
 #endif
 
 #include "offline-listener.h"
-#include <libedata-book/e-data-book-factory.h>
-#if ENABLE_CALENDAR
 #include <libedata-cal/e-data-cal-factory.h>
-#endif
 #include <gconf/gconf-client.h>
 
 enum {
@@ -43,10 +40,8 @@ struct _OfflineListenerPrivate
 {
 	GConfClient *default_client;
 
-#if ENABLE_CALENDAR
 	EDataCalFactory *cal_factory;
-#endif
-	EDataBookFactory *book_factory;
+
 	gboolean is_offline_now;
 };
 
@@ -57,12 +52,8 @@ set_online_status (OfflineListener *offline_listener, gboolean is_offline)
 
 	priv = offline_listener->priv;
 
-#if ENABLE_CALENDAR
 	e_data_cal_factory_set_backend_mode
 		(priv->cal_factory, is_offline ? OFFLINE_MODE : ONLINE_MODE);
-#endif
-	e_data_book_factory_set_backend_mode
-		(priv->book_factory, is_offline ? OFFLINE_MODE : ONLINE_MODE);
 }
 
 static void
@@ -98,21 +89,13 @@ setup_offline_listener (OfflineListener *offline_listener)
 	set_online_status (offline_listener, priv->is_offline_now);
 }
 
-#if ENABLE_CALENDAR
 OfflineListener*
-offline_listener_new (EDataBookFactory *book_factory, EDataCalFactory *cal_factory)
-#else
-OfflineListener*
-offline_listener_new (EDataBookFactory *book_factory)
-#endif
+offline_listener_new (EDataCalFactory *cal_factory)
 {
 	OfflineListener *offline_listener = g_object_new (OFFLINE_TYPE_LISTENER, NULL);
 	OfflineListenerPrivate *priv = offline_listener->priv;
 
-	priv->book_factory = book_factory;
-#if ENABLE_CALENDAR
 	priv->cal_factory = cal_factory;
-#endif
 	setup_offline_listener (offline_listener);
 	return offline_listener;
 
diff --git a/src/offline-listener.h b/src/offline-listener.h
index 68ffe45..c1c833f 100644
--- a/src/offline-listener.h
+++ b/src/offline-listener.h
@@ -28,10 +28,7 @@
 #endif
 
 #include <glib-object.h>
-#include <libedata-book/e-data-book-factory.h>
-#if ENABLE_CALENDAR
 #include <libedata-cal/e-data-cal-factory.h>
-#endif
 
 G_BEGIN_DECLS
 
@@ -58,11 +55,7 @@ struct _OfflineListenerClass {
 
 GType offline_listener_get_type  (void);
 
-#if ENABLE_CALENDAR
-OfflineListener  *offline_listener_new (EDataBookFactory *book_factory, EDataCalFactory *cal_factory);
-#else
-OfflineListener  *offline_listener_new (EDataBookFactory *book_factory);
-#endif
+OfflineListener  *offline_listener_new (EDataCalFactory *cal_factory);
 
 G_END_DECLS
 
diff --git a/src/server.c b/src/server.c
index b76cc57..7b32861 100644
--- a/src/server.c
+++ b/src/server.c
@@ -42,10 +42,7 @@
 #include <gconf/gconf-client.h>
 
 #include <libebackend/e-data-server-module.h>
-#include <libedata-book/e-data-book-factory.h>
-#if ENABLE_CALENDAR
 #include <libedata-cal/e-data-cal-factory.h>
-#endif
 
 #ifdef G_OS_WIN32
 #include <libedataserver/e-data-server-util.h>
@@ -59,15 +56,10 @@
 #define E_DATA_SERVER_LOGGING_OAF_ID "OAFIID:GNOME_Evolution_DataServer_Logging"
 
 #define E_DATA_CAL_FACTORY_OAF_ID "OAFIID:GNOME_Evolution_DataServer_CalFactory:" API_VERSION
-#define E_DATA_BOOK_FACTORY_OAF_ID "OAFIID:GNOME_Evolution_DataServer_BookFactory:" API_VERSION
 
-/* The and addressbook calendar factories */
+/* The calendar factory */
 
-#if ENABLE_CALENDAR
 static EDataCalFactory *e_data_cal_factory;
-#endif
-
-static EDataBookFactory *e_data_book_factory;
 
 /* The other interfaces we implement */
 
@@ -92,10 +84,7 @@ termination_handler (gpointer data)
 {
 	gint count = 0;
 
-#if ENABLE_CALENDAR
 	count += e_data_cal_factory_get_n_backends (e_data_cal_factory);
-#endif
-	count += e_data_book_factory_get_n_backends (e_data_book_factory);
 
 	if (count == 0) {
 		g_message ("termination_handler(): Terminating the Server.  Have a nice day.");
@@ -119,41 +108,8 @@ queue_termination (void)
 }
 
 
-
-static void
-last_book_gone_cb (EDataBookFactory *factory, gpointer data)
-{
-	queue_termination ();
-}
-
-static gboolean
-setup_books (void)
-{
-	e_data_book_factory = e_data_book_factory_new ();
-
-	if (!e_data_book_factory)
-		return FALSE;
-
-	e_data_book_factory_register_backends (e_data_book_factory);
-
-	g_signal_connect (e_data_book_factory,
-			  "last_book_gone",
-			  G_CALLBACK (last_book_gone_cb),
-			  NULL);
-
-	if (!e_data_book_factory_activate (e_data_book_factory, E_DATA_BOOK_FACTORY_OAF_ID)) {
-		bonobo_object_unref (BONOBO_OBJECT (e_data_book_factory));
-		e_data_book_factory = NULL;
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-
 /* Personal calendar server */
 
-#if ENABLE_CALENDAR
 /* Callback used when the calendar factory has no more running backends */
 static void
 last_calendar_gone_cb (EDataCalFactory *factory, gpointer data)
@@ -188,14 +144,6 @@ setup_cals (void)
 	return TRUE;
 
 }
-#else
-static gboolean
-setup_cals (void)
-{
-	return TRUE;
-}
-#endif
-
 
 /* Logging iface.  */
 static gboolean
@@ -215,7 +163,6 @@ setup_logging (void)
 	server_logging_register_domain (logging_iface, "GThread");
 
 	server_logging_register_domain (logging_iface, "evolution-data-server");
-	server_logging_register_domain (logging_iface, "libebookbackend");
 	server_logging_register_domain (logging_iface, "libecalbackendfile");
 
 	result = bonobo_activation_active_server_register (E_DATA_SERVER_LOGGING_OAF_ID,
@@ -243,10 +190,7 @@ setup_interface_check (void)
 static void
 dump_backends (gint signal)
 {
-	e_data_book_factory_dump_active_backends (e_data_book_factory);
-#if ENABLE_CALENDAR
 	e_data_cal_factory_dump_active_backends (e_data_cal_factory);
-#endif
 }
 #endif
 
@@ -293,7 +237,6 @@ libdir (void)
 gint
 main (gint argc, gchar **argv)
 {
-	gboolean did_books=FALSE, did_cals=FALSE;
 	OfflineListener *offline_listener = NULL;
 
 	bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
@@ -313,38 +256,19 @@ main (gint argc, gchar **argv)
 
 	e_data_server_module_init ();
 
-	if (!( (did_books = setup_books ())
-	       && (did_cals = setup_cals ())
-		    )) {
-
-		const gchar *failed = NULL;
-
-		if (!did_books)
-			failed = "BOOKS";
-		else if (!did_cals)
-			failed = "CALS";
+	if (!setup_cals ()) {
 
-		g_warning (G_STRLOC ": could not initialize Server service \"%s\"; terminating", failed);
-
-		if (e_data_book_factory) {
-			bonobo_object_unref (BONOBO_OBJECT (e_data_book_factory));
-			e_data_book_factory = NULL;
-		}
+		g_warning (G_STRLOC ": could not initialize Server service \"CALS\"; terminating");
 
-#if ENABLE_CALENDAR
 		if (e_data_cal_factory) {
 			bonobo_object_unref (BONOBO_OBJECT (e_data_cal_factory));
 			e_data_cal_factory = NULL;
 		}
-#endif
+
 		exit (EXIT_FAILURE);
 	}
 
-#if ENABLE_CALENDAR
-	offline_listener = offline_listener_new (e_data_book_factory, e_data_cal_factory);
-#else
-	offline_listener = offline_listener_new (e_data_book_factory);
-#endif
+	offline_listener = offline_listener_new (e_data_cal_factory);
 
 	if ( setup_logging ()) {
 			if ( setup_interface_check ()) {
@@ -358,13 +282,8 @@ main (gint argc, gchar **argv)
 
 	g_object_unref (offline_listener);
 
-#if ENABLE_CALENDAR
 	bonobo_object_unref (BONOBO_OBJECT (e_data_cal_factory));
 	e_data_cal_factory = NULL;
-#endif
-
-	bonobo_object_unref (BONOBO_OBJECT (e_data_book_factory));
-	e_data_book_factory = NULL;
 
 	bonobo_object_unref (BONOBO_OBJECT (logging_iface));
 	logging_iface = NULL;



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