From 0f6c6bbb8cb76ba673a10b11407100d02919be04 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 12 Apr 2001 18:44:41 +0000 Subject: put the business address into the pilot record as that is what we put into 2001-04-12 JP Rosevear * conduit/address-conduit.c (local_record_from_ecard): put the business address into the pilot record as that is what we put into the desktop record (ecard_from_remote_record): set both the address label and delivery address to avoid bad parser guessing, fixes #2143 * backend/ebook/e-card-types.h: remove deprecated pilot code * backend/ebook/e-card.c: ditto * backend/ebook/e-card.h: ditto svn path=/trunk/; revision=9279 --- addressbook/conduit/address-conduit.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'addressbook/conduit') diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 78db75c99d..428584b9c4 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -363,7 +363,7 @@ local_record_from_ecard (EAddrLocalRecord *local, ECard *ecard, EAddrConduitCont local->addr->entry[entryTitle] = e_pilot_utf8_to_pchar (ecard->title); } - delivery = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME); + delivery = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS); if (delivery) { local->addr->entry[entryAddress] = e_pilot_utf8_to_pchar (delivery->street); local->addr->entry[entryCity] = e_pilot_utf8_to_pchar (delivery->city); @@ -434,6 +434,7 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, ECard *ecard; ECardSimple *simple; ECardDeliveryAddress delivery; + ECardAddrLabel label; char *string; char *stringparts[3]; int i; @@ -474,7 +475,7 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, /* Address */ memset (&delivery, 0, sizeof (ECardDeliveryAddress)); - delivery.flags = E_CARD_ADDR_HOME; + delivery.flags = E_CARD_ADDR_WORK; if (address.entry[entryAddress]) delivery.street = get_entry_text (address, entryAddress); if (address.entry[entryCity]) @@ -486,16 +487,19 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, if (address.entry[entryZip]) delivery.code = get_entry_text (address, entryZip); - string = e_card_delivery_address_to_string (&delivery); - e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS, string); - g_free (string); + label.flags = E_CARD_ADDR_WORK; + label.data = e_card_delivery_address_to_string (&delivery); + + e_card_simple_set_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS, &label); + e_card_simple_set_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS, &delivery); free (delivery.street); free (delivery.city); free (delivery.region); free (delivery.country); free (delivery.code); - + g_free (label.data); + /* Phone numbers */ for (i = entryPhone1; i <= entryPhone5; i++) { char *phonelabel = ctxt->ai.phoneLabels[address.phoneLabel[i - entryPhone1]]; @@ -517,8 +521,6 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_PHONE_PAGER, phonenum); else if (!strcmp (phonelabel, "Mobile")) e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_PHONE_MOBILE, phonenum); - - g_print (" ['%s' : '%s']\n", phonelabel, phonenum); g_free (phonenum); } -- cgit