From 780baefeb6ccdbf33efd36beda2c4b50d1f569b3 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 14 Apr 2000 11:09:04 +0000 Subject: Must pass "object" for the kind to goad_server_register(); "server" is 2000-04-14 Federico Mena Quintero * wombat.c (setup_pcs): Must pass "object" for the kind to goad_server_register(); "server" is meaningless. (setup_pcs): Do not free the CORBA environment more than once. Also, fix error messages. * wombat.gnorba: The GOAD ID is "evolution:calendar-factory", not "evolution:calendar-server". * ChangeLog: Started the ChangeLog for Wombat. svn path=/trunk/; revision=2423 --- wombat/wombat.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'wombat/wombat.c') diff --git a/wombat/wombat.c b/wombat/wombat.c index 989df9b484..24cae9713c 100644 --- a/wombat/wombat.c +++ b/wombat/wombat.c @@ -38,17 +38,19 @@ setup_pas (int argc, char **argv) pas_book_factory_activate (factory); } - +/* Creates the calendar factory object and registers it with GOAD */ static void setup_pcs (int argc, char **argv) { + CalFactory *factory; int result; CORBA_Object object; - CalFactory *factory = cal_factory_new (); - + + factory = cal_factory_new (); + if (!factory) { - g_message ("%s: %d: couldn't create a Calendar factory\n", - __FILE__, __LINE__); + g_message ("setup_pcs(): Could not create the calendar factory"); + return; } object = bonobo_object_corba_objref (BONOBO_OBJECT (factory)); @@ -57,26 +59,30 @@ setup_pcs (int argc, char **argv) result = goad_server_register (CORBA_OBJECT_NIL, object, "evolution:calendar-factory", - "server", + "object", &ev); - if (ev._major != CORBA_NO_EXCEPTION || result == -1) { + /* FIXME: should Wombat die if it gets errors here? */ - g_message ("create_cal_factory(): " - "could not register the calendar factory"); + if (ev._major != CORBA_NO_EXCEPTION || result == -1) { + g_message ("setup_pcs(): could not register the calendar factory"); bonobo_object_unref (BONOBO_OBJECT (factory)); CORBA_exception_free (&ev); - + return; } else if (result == -2) { - - g_message ("create_cal_factory(): " - "a calendar factory is already registered"); + g_message ("setup_pcs(): a calendar factory is already registered"); bonobo_object_unref (BONOBO_OBJECT (factory)); CORBA_exception_free (&ev); - + return; } - CORBA_exception_free (&ev); + /* FIXME: we never connect to the destroy signal of the factory. We + * need to add a signal to it to indicate that the last client died. + * The PAS factory needs to have the same thing. When Wombat sees that + * both factories have lost all their clients, it should destroy the + * factories and terminate. */ + + CORBA_exception_free (&ev); } static void -- cgit