From 079a4f233c9ab86629e380387219d3168828900f Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Mon, 14 Aug 2000 00:46:10 +0000 Subject: add special oaf initialization hack so conduit can find wombat, and accept 2000-08-13 Chris Toshok * conduit/address-conduit.c (conduit_get_gpilot_conduit): add special oaf initialization hack so conduit can find wombat, and accept all cookies so that we can actually talk to oaf. svn path=/trunk/; revision=4829 --- addressbook/conduit/address-conduit.c | 36 +++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'addressbook/conduit') diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 5de6e5447c..0c79daaaee 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -21,6 +21,8 @@ #include #include "ebook/e-book-types.h" +#include + GnomePilotConduit * conduit_get_gpilot_conduit (guint32); void conduit_destroy_gpilot_conduit (GnomePilotConduit*); void local_record_from_ecard (AddressbookLocalRecord *local, ECard *ecard); @@ -32,6 +34,7 @@ void local_record_from_ecard (AddressbookLocalRecord *local, ECard *ecard); #define G_LOG_DOMAIN "addressconduit" /* #define SUPPORT_ARCHIVING 1 */ +#define NEED_OAF_INIT_HACK 1 #define DEBUG_ADDRESSBOOKCONDUIT 1 #ifdef DEBUG_ADDRESSBOOKCONDUIT @@ -995,7 +998,8 @@ transmit (GnomePilotConduitStandardAbs *conduit, get_phone_label_by_flag (&ctxt->ai, phone->flags); local->address->entry [ phone_entry ] = strdup (phone->number); - /* only store 5 numbers */ + /* only store a maximum of 5 numbers (4 if + there was an email address) */ if (phone_entry == entryPhone5) break; @@ -1161,6 +1165,16 @@ delete_all (GnomePilotConduitStandardAbs *conduit, return 0; } +#ifdef NEED_OAF_INIT_HACK +static ORBit_MessageValidationResult +accept_all_cookies (CORBA_unsigned_long request_id, + CORBA_Principal *principal, + CORBA_char *operation) +{ + /* allow ALL cookies */ + return ORBIT_MESSAGE_ALLOW_ALL; +} +#endif GnomePilotConduit * conduit_get_gpilot_conduit (guint32 pilotId) @@ -1171,9 +1185,27 @@ conduit_get_gpilot_conduit (guint32 pilotId) printf ("in address's conduit_get_gpilot_conduit\n"); +#ifdef NEED_OAF_INIT_HACK +#warning "need a better way to do this" + /* we need to find wombat with oaf, so make sure oaf + is initialized here. once the desktop is converted + to oaf and gpilotd is built with oaf, this can go away */ + if (! oaf_is_initialized ()) + { + char *argv[ 1 ] = {"hi"}; + oaf_init (1, argv); + + if (bonobo_init (CORBA_OBJECT_NIL, + CORBA_OBJECT_NIL, + CORBA_OBJECT_NIL) == FALSE) + g_error (_("Could not initialize Bonobo")); + + ORBit_set_request_validation_handler (accept_all_cookies); + } +#endif + retval = gnome_pilot_conduit_standard_abs_new ("AddressDB", 0x61646472); - g_assert (retval != NULL); gnome_pilot_conduit_construct(GNOME_PILOT_CONDUIT(retval),"AddressConduit"); -- cgit v1.2.3