[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Avoid duplicate phone and address entries
From: |
Keith Packard |
Subject: |
[PATCH] Avoid duplicate phone and address entries |
Date: |
Sun, 8 Jul 2007 21:33:01 -0700 |
---
common/phones/nk6510.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/common/phones/nk6510.c b/common/phones/nk6510.c
index d48ea49..81eca47 100644
--- a/common/phones/nk6510.c
+++ b/common/phones/nk6510.c
@@ -2387,10 +2387,19 @@ static gn_error NK6510_WritePhonebookLocation(gn_data
*data, struct gn_statemach
case GN_PHONEBOOK_ENTRY_StateProvince:
case GN_PHONEBOOK_ENTRY_ZipCode:
case GN_PHONEBOOK_ENTRY_Country:
+ case GN_PHONEBOOK_ENTRY_Postal:
case GN_PHONEBOOK_ENTRY_LastName:
case GN_PHONEBOOK_ENTRY_FirstName:
break;
case GN_PHONEBOOK_ENTRY_Number:
+ for (j = 0; j < i; j++) {
+ if
(entry->subentries[i].entry_type == entry->subentries[j].entry_type &&
+
entry->subentries[i].number_type == entry->subentries[j].number_type &&
+ !strcmp
(entry->subentries[i].data.number, entry->subentries[j].data.number))
+ break;
+ }
+ if (j < i)
+ break;
if (i != defaultn) {
string[0] =
entry->subentries[i].number_type;
string[1] = string[2] =
string[3] = 0;
@@ -2447,11 +2456,20 @@ static gn_error NK6510_WritePhonebookLocation(gn_data
*data, struct gn_statemach
for (i = 0; i < entry->subentries_count; i++) {
switch
(entry->subentries[i].entry_type) {
case GN_PHONEBOOK_ENTRY_ExtendedAddress:
+ case GN_PHONEBOOK_ENTRY_Postal:
case GN_PHONEBOOK_ENTRY_Street:
case GN_PHONEBOOK_ENTRY_City:
case GN_PHONEBOOK_ENTRY_StateProvince:
case GN_PHONEBOOK_ENTRY_ZipCode:
case GN_PHONEBOOK_ENTRY_Country:
+ for (j = 0; j < i; j++) {
+ if
(entry->subentries[i].entry_type == entry->subentries[j].entry_type &&
+
entry->subentries[i].number_type == entry->subentries[j].number_type &&
+ !strcmp
(entry->subentries[i].data.number, entry->subentries[j].data.number))
+ break;
+ }
+ if (j < i)
+ break;
j =
strlen(entry->subentries[i].data.number);
j = char_unicode_encode((string
+ 1), entry->subentries[i].data.number, j);
string[j + 1] = 0;
--
1.5.2.2
- Fixes to avoid locking up 6131 phone and send more useful data, Keith Packard, 2007/07/09
- [PATCH] When processing incoming phone book messages, skip unrelated errors., Keith Packard, 2007/07/09
- [PATCH] Limit phonebook to 1000 entries (as on 6131), Keith Packard, 2007/07/09
- [PATCH] Account for phonebook blocks not sent due to limited packet space, Keith Packard, 2007/07/09
- [PATCH] Support termination of repeating events, Keith Packard, 2007/07/09
- [PATCH] Speed up calendar fetch by not restarting note fetch, Keith Packard, 2007/07/09
- [PATCH] Delete message when write fails, Keith Packard, 2007/07/09
- [PATCH] Avoid duplicate phone and address entries,
Keith Packard <=
- [PATCH] treat Postal entries as addresses, Keith Packard, 2007/07/09
- [PATCH] Set of address blocks counts as one data block., Keith Packard, 2007/07/09
- Re: [Opensync-users] [PATCH] treat Postal entries as addresses, Pawel Kot, 2007/07/09
- Re: [Opensync-users] [PATCH] Avoid duplicate phone and address entries, Pawel Kot, 2007/07/09
- Re: [Opensync-users] [PATCH] Avoid duplicate phone and address entries, Keith Packard, 2007/07/09
- Re: [Opensync-users] [PATCH] Avoid duplicate phone and address entries, Pawel Kot, 2007/07/09
- Re: [Opensync-users] [PATCH] Delete message when write fails, Pawel Kot, 2007/07/09
- Re: [Opensync-users] [PATCH] Delete message when write fails, Keith Packard, 2007/07/09
- Re: [Opensync-users] [PATCH] Speed up calendar fetch by not restarting note fetch, Pawel Kot, 2007/07/09
- Re: [Opensync-users] [PATCH] Speed up calendar fetch by not restarting note fetch, Keith Packard, 2007/07/09