diff options
author | JP Rosevear <jpr@ximian.com> | 2001-10-30 02:47:09 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-10-30 02:47:09 +0800 |
commit | 1bb087628924818877b6b345cdfe8b41838be60e (patch) | |
tree | 47f7e7d523ae192a3de9056e5e992893cf539c3f | |
parent | 44f724adfe5d6c7bef583bb96fa71c9e94110708 (diff) | |
download | gsoc2013-evolution-1bb087628924818877b6b345cdfe8b41838be60e.tar.gz gsoc2013-evolution-1bb087628924818877b6b345cdfe8b41838be60e.tar.zst gsoc2013-evolution-1bb087628924818877b6b345cdfe8b41838be60e.zip |
fix bug that allowed for phone's not to be in priority order and the item
2001-10-29 JP Rosevear <jpr@ximian.com>
* conduit/address-conduit.c (is_syncable): fix bug that allowed
for phone's not to be in priority order and the item to still be
syncable
* conduit/address-conduit-config.h
(addrconduit_load_configuration): get management by id
svn path=/trunk/; revision=14350
-rw-r--r-- | addressbook/ChangeLog | 9 | ||||
-rw-r--r-- | addressbook/conduit/address-conduit-config.h | 2 | ||||
-rw-r--r-- | addressbook/conduit/address-conduit.c | 85 |
3 files changed, 43 insertions, 53 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index c975ddf870..d0d04d85ab 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,14 @@ 2001-10-29 JP Rosevear <jpr@ximian.com> + * conduit/address-conduit.c (is_syncable): fix bug that allowed + for phone's not to be in priority order and the item to still be + syncable + + * conduit/address-conduit-config.h + (addrconduit_load_configuration): get management by id + +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" diff --git a/addressbook/conduit/address-conduit-config.h b/addressbook/conduit/address-conduit-config.h index 973bc4fd10..4042eff423 100644 --- a/addressbook/conduit/address-conduit-config.h +++ b/addressbook/conduit/address-conduit-config.h @@ -52,7 +52,7 @@ addrconduit_load_configuration (EAddrConduitCfg **c, guint32 pilot_id) g_assert (*c != NULL); (*c)->pilot_id = pilot_id; - management = gnome_pilot_conduit_management_new ("EAddress", GNOME_PILOT_CONDUIT_MGMT_NAME); + management = gnome_pilot_conduit_management_new ("e_address_conduit", GNOME_PILOT_CONDUIT_MGMT_ID); config = gnome_pilot_conduit_config_new (management, pilot_id); if (!gnome_pilot_conduit_config_is_enabled (config, &(*c)->sync_type)) (*c)->sync_type = GnomePilotConduitSyncTypeNotSet; diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 1cff3c234f..016c5495a9 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -502,97 +502,78 @@ 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, l = 0, lastphone = entryPhone5; + int i, l = 0; - /* 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 */ + /* See if there are fields we can't sync or not in priority order */ get_next_init (&next_mail, &next_home, &next_work, &next_fax, &next_other, &next_main, &next_pager, &next_mobile); - for (i = entryPhone1; i <= entryPhone5; i++) { + for (i = entryPhone1; i <= entryPhone5 && syncable; i++) { char *phonelabel = ctxt->ai.phoneLabels[local->addr->phoneLabel[i - entryPhone1]]; const char *phone_str = local->addr->entry[i]; + gboolean empty = !(phone_str && *phone_str); + + if (empty) + continue; + + for ( ; priority_label[l] != NULL; l++) + if (!strcmp (phonelabel, priority_label[l])) + break; + + if (priority_label[l] == NULL) { + syncable = FALSE; + continue; + } if (!strcmp (phonelabel, "E-mail")) { - if (is_next_done (next_mail)) { + if (is_next_done (next_mail) || next_mail != priority[l]) { syncable = FALSE; break; } - if (phone_str && *phone_str) - next_mail = get_next_mail (&next_mail); + next_mail = get_next_mail (&next_mail); } else if (!strcmp (phonelabel, "Home")) { - if (is_next_done (next_home)) { + if (is_next_done (next_home) || next_home != priority[l]) { syncable = FALSE; break; } - if (phone_str && *phone_str) - next_home = get_next_home (&next_home); + next_home = get_next_home (&next_home); } else if (!strcmp (phonelabel, "Work")) { - if (is_next_done (next_work)) { + if (is_next_done (next_work) || next_work != priority[l]) { syncable = FALSE; break; } - if (phone_str && *phone_str) - next_work = get_next_work (&next_work); + next_work = get_next_work (&next_work); } else if (!strcmp (phonelabel, "Fax")) { - if (is_next_done (next_fax)) { + if (is_next_done (next_fax) || next_fax != priority[l]) { syncable = FALSE; break; } - if (phone_str && *phone_str) - next_fax = get_next_fax (&next_fax); + next_fax = get_next_fax (&next_fax); } else if (!strcmp (phonelabel, "Other")) { - if (is_next_done (next_other)) { + if (is_next_done (next_other) || next_other != priority[l]) { syncable = FALSE; break; } - if (phone_str && *phone_str) - next_other = get_next_other (&next_other); + next_other = get_next_other (&next_other); } else if (!strcmp (phonelabel, "Main")) { - if (is_next_done (next_main)) { + if (is_next_done (next_main) || next_main != priority[l]) { syncable = FALSE; break; } - if (phone_str && *phone_str) - next_main = get_next_main (&next_main); + next_main = get_next_main (&next_main); } else if (!strcmp (phonelabel, "Pager")) { - if (is_next_done (next_pager)) { + if (is_next_done (next_pager) || next_pager != priority[l]) { syncable = FALSE; break; } - if (phone_str && *phone_str) - next_pager = get_next_pager (&next_pager); + next_pager = get_next_pager (&next_pager); } else if (!strcmp (phonelabel, "Mobile")) { - if (is_next_done (next_mobile)) { + if (is_next_done (next_mobile) || next_mobile != priority[l]) { syncable = FALSE; break; } - if (phone_str && *phone_str) - next_mobile = get_next_mobile (&next_mobile); - } + next_mobile = get_next_mobile (&next_mobile); + } } return syncable; |