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 /addressbook/conduit | |
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
Diffstat (limited to 'addressbook/conduit')
-rw-r--r-- | addressbook/conduit/address-conduit.c | 26 |
1 files changed, 25 insertions, 1 deletions
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); |