diff options
author | JP Rosevear <jpr@ximian.com> | 2001-10-30 00:39:09 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-10-30 00:39:09 +0800 |
commit | 8650735ac6fc68c6465554fd2b0e3edc26d87b14 (patch) | |
tree | 823e61e19f6acad137a27c82d5e70651e7100b73 | |
parent | 8155b1b56cebd33a357ed163357d216d2c4486ca (diff) | |
download | gsoc2013-evolution-8650735ac6fc68c6465554fd2b0e3edc26d87b14.tar.gz gsoc2013-evolution-8650735ac6fc68c6465554fd2b0e3edc26d87b14.tar.zst gsoc2013-evolution-8650735ac6fc68c6465554fd2b0e3edc26d87b14.zip |
a card also needs to have its phone nums in priority order to be
2001-10-29 JP Rosevear <jpr@ximian.com>
* conduit/address-conduit.c (is_syncable): a card also needs to
have its phone nums in priority order to be "syncable"
svn path=/trunk/; revision=14344
-rw-r--r-- | addressbook/ChangeLog | 5 | ||||
-rw-r--r-- | addressbook/conduit/address-conduit.c | 26 |
2 files changed, 30 insertions, 1 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 4cc3e05c2e..c975ddf870 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,10 @@ 2001-10-29 JP Rosevear <jpr@ximian.com> + * conduit/address-conduit.c (is_syncable): a card also needs to + have its phone nums in priority order to be "syncable" + +2001-10-29 JP Rosevear <jpr@ximian.com> + * conduit/address-conduit.c (is_syncable): move the syncable checking code to a different function (ecard_from_remote_record): set the name parts individually diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 00d52eb6d5..1cff3c234f 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -502,8 +502,32 @@ is_syncable (EAddrConduitContext *ctxt, EAddrLocalRecord *local) ECardSimpleField next_mail, next_home, next_work, next_fax; ECardSimpleField next_other, next_main, next_pager, next_mobile; gboolean syncable = TRUE; - int i; + int i, l = 0, lastphone = entryPhone5; + + /* See if the fields are in priority order */ + for ( ; lastphone >= entryPhone1; lastphone--) { + const char *phone_str = local->addr->entry[lastphone]; + + if (phone_str && *phone_str) + break; + } + + /* if they are all blank */ + if (lastphone < entryPhone1) + return TRUE; + /* See if the fields are in priority order */ + for (i = entryPhone1; i <= lastphone && priority_label[l] != NULL; i++) { + char *phonelabel = ctxt->ai.phoneLabels[local->addr->phoneLabel[i - entryPhone1]]; + + for ( ; priority_label[l] != NULL; l++) + if (!strcmp (phonelabel, priority_label[l])) + break; + } + + if (priority_label[l] == NULL) + return FALSE; + /* See if there are fields we can't sync */ get_next_init (&next_mail, &next_home, &next_work, &next_fax, &next_other, &next_main, &next_pager, &next_mobile); |