diff options
-rw-r--r-- | addressbook/ChangeLog | 7 | ||||
-rw-r--r-- | addressbook/conduit/address-conduit.c | 21 |
2 files changed, 25 insertions, 3 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index c324a33267..6a9bda855c 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,10 @@ +2003-03-26 JP Rosevear <jpr@ximian.com> + + * conduit/address-conduit.c (local_record_from_ecard): append the + second line to the address if necessary + (ecard_from_remote_record): split the address line in two if + necessary + 2003-03-23 Chris Toshok <toshok@ximian.com> * gui/contact-list-editor/contact-list-editor.glade: set the diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index b6165b4b2d..8bca97d9b9 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -958,7 +958,16 @@ local_record_from_ecard (EAddrLocalRecord *local, ECard *ecard, EAddrConduitCont delivery = e_card_simple_get_delivery_address (simple, mailing_address); if (delivery) { - local->addr->entry[entryAddress] = e_pilot_utf8_to_pchar (delivery->street); + char *add; + + /* If the address has 2 lines, make sure both get added */ + if (delivery->ext != NULL) + add = g_strconcat (delivery->street, "\n", delivery->ext, NULL); + else + add = g_strdup (delivery->street); + local->addr->entry[entryAddress] = e_pilot_utf8_to_pchar (add); + g_free (add); + local->addr->entry[entryCity] = e_pilot_utf8_to_pchar (delivery->city); local->addr->entry[entryState] = e_pilot_utf8_to_pchar (delivery->region); local->addr->entry[entryZip] = e_pilot_utf8_to_pchar (delivery->code); @@ -1082,7 +1091,7 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, ECardDeliveryAddress *delivery; ECardAddrLabel *label; ECardSimpleAddressId mailing_address; - char *txt; + char *txt, *find; ECardSimpleField next_mail, next_home, next_work, next_fax; ECardSimpleField next_other, next_main, next_pager, next_mobile; int i; @@ -1137,7 +1146,13 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, delivery = e_card_delivery_address_new (); delivery->flags |= E_CARD_ADDR_DEFAULT; - delivery->street = get_entry_text (address, entryAddress); + txt = get_entry_text (address, entryAddress); + if ((find = strchr (txt, '\n')) != NULL) { + *find = '\0'; + find++; + } + delivery->street = txt; + delivery->ext = find != NULL ? find : g_strdup (""); delivery->city = get_entry_text (address, entryCity); delivery->region = get_entry_text (address, entryState); delivery->country = get_entry_text (address, entryCountry); |