diff options
author | JP Rosevear <jpr@ximian.com> | 2001-09-27 01:31:33 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-09-27 01:31:33 +0800 |
commit | 781b9204d274e1fa64c256e71147392e83cd2f08 (patch) | |
tree | e58bbf476e0b4564c6d2f5cbc7f710554d3fa3b9 /addressbook/conduit | |
parent | fbc4f8863895af7fd34d34f133e64f60a805c825 (diff) | |
download | gsoc2013-evolution-781b9204d274e1fa64c256e71147392e83cd2f08.tar.gz gsoc2013-evolution-781b9204d274e1fa64c256e71147392e83cd2f08.tar.zst gsoc2013-evolution-781b9204d274e1fa64c256e71147392e83cd2f08.zip |
set the last_use and use_score fields of the card to known values so the
2001-09-26 JP Rosevear <jpr@ximian.com>
* backend/pas/pas-backend-file.c (pas_backend_file_changes): set
the last_use and use_score fields of the card to known values so
the card doesn't register as changed when only they have changed
2001-09-26 Peter Williams <peterw@ximian.com>
* conduit/address-conduit.c (ecard_from_remote_record): Fix this function
to set email addresses properly, and handle multiple occurrences of
email addresses, home phone numbers, and business phone numbers.
svn path=/trunk/; revision=13153
Diffstat (limited to 'addressbook/conduit')
-rw-r--r-- | addressbook/conduit/address-conduit.c | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 3c2928cca2..13fb05a3b4 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -453,6 +453,8 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, char *txt; char *stringparts[3]; int i; + ECardSimpleEmailId last_email; + ECardSimpleField last_business, last_home; g_return_val_if_fail(remote!=NULL,NULL); memset (&address, 0, sizeof (struct Address)); @@ -505,19 +507,50 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, free (delivery.country); free (delivery.code); g_free (label.data); - + + last_email = E_CARD_SIMPLE_EMAIL_ID_EMAIL; + last_business = E_CARD_SIMPLE_FIELD_PHONE_BUSINESS; + last_home = E_CARD_SIMPLE_FIELD_PHONE_HOME; + /* Phone numbers */ for (i = entryPhone1; i <= entryPhone5; i++) { char *phonelabel = ctxt->ai.phoneLabels[address.phoneLabel[i - entryPhone1]]; char *phonenum = get_entry_text (address, i); - if (!strcmp (phonelabel, "E-mail")) - e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_EMAIL, phonenum); - else if (!strcmp (phonelabel, "Home")) - e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_PHONE_HOME, phonenum); - else if (!strcmp (phonelabel, "Work")) - e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_PHONE_BUSINESS, phonenum); - else if (!strcmp (phonelabel, "Fax")) + if (!strcmp (phonelabel, "E-mail")) { + e_card_simple_set_email(simple, last_email, phonenum); + + switch (last_email) { + case E_CARD_SIMPLE_EMAIL_ID_EMAIL: + last_email = E_CARD_SIMPLE_EMAIL_ID_EMAIL_2; + break; + case E_CARD_SIMPLE_EMAIL_ID_EMAIL_2: + last_email = E_CARD_SIMPLE_EMAIL_ID_EMAIL_3; + break; + default: + WARN ("ran out of email fields in ecard_from_remote_record!"); + } + } else if (!strcmp (phonelabel, "Home")) { + e_card_simple_set(simple, last_home, phonenum); + + switch (last_home) { + case E_CARD_SIMPLE_FIELD_PHONE_HOME: + last_home = E_CARD_SIMPLE_FIELD_PHONE_HOME_2; + break; + default: + WARN ("ran out of home phone fields in ecard_from_remote_record!"); + } + } else if (!strcmp (phonelabel, "Work")) { + e_card_simple_set(simple, last_business, phonenum); + + switch (last_business) { + case E_CARD_SIMPLE_FIELD_PHONE_BUSINESS: + last_business = E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2; + break; + default: + WARN ("ran out of home phone fields in ecard_from_remote_record!"); + } + } else if (!strcmp (phonelabel, "Fax")) e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX, phonenum); else if (!strcmp (phonelabel, "Other")) e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_PHONE_OTHER, phonenum); |