From: Sivaiah Nallagatla Date: Mon, 19 Jul 2004 05:33:07 +0000 (+0000) Subject: provided implementation, search in all fileds of all types of addresses X-Git-Tag: upstream/3.7.4~8551 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=976302404a135aa709f1bc60bad8161c55ada5bc;p=platform%2Fupstream%2Fevolution-data-server.git provided implementation, search in all fileds of all types of addresses 2004-07-19 Sivaiah Nallagatla * libedata-book/e-book-backend-sexp.c (compare_address) : provided implementation, search in all fileds of all types of addresses till a match occurs Fixes #58701 --- diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index a3139c2..77b885b 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,10 @@ +2004-07-19 Sivaiah Nallagatla + + * libedata-book/e-book-backend-sexp.c (compare_address) : provided + implementation, search in all fileds of all types of addresses + till a match occurs + Fixes #58701 + 2004-07-16 Chris Toshok [ fixes #61052 ] diff --git a/addressbook/libedata-book/e-book-backend-sexp.c b/addressbook/libedata-book/e-book-backend-sexp.c index d6304ce..12b3315 100644 --- a/addressbook/libedata-book/e-book-backend-sexp.c +++ b/addressbook/libedata-book/e-book-backend-sexp.c @@ -152,8 +152,30 @@ static gboolean compare_address (EContact *contact, const char *str, char *(*compare)(const char*, const char*)) { - g_warning("address searching not implemented\n"); - return FALSE; + + int i; + gboolean rv = FALSE; + + for (i = E_CONTACT_FIRST_ADDRESS_ID; i <= E_CONTACT_LAST_ADDRESS_ID; i ++) { + EContactAddress *address = e_contact_get (contact, i); + if (address) { + rv = (address->po && compare(address->po, str)) || + (address->street && compare(address->street, str)) || + (address->ext && compare(address->ext, str)) || + (address->locality && compare(address->locality, str)) || + (address->region && compare(address->region, str)) || + (address->code && compare(address->code, str)) || + (address->country && compare(address->country, str)); + + e_contact_address_free (address); + + if (rv) + break; + } + } + + return rv; + } static gboolean