diff options
author | Cedric Bosdonnat <cedricbosdo@openoffice.org> | 2010-01-07 23:01:19 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-01-07 23:01:19 +0800 |
commit | 84d1cc73e2b9765b02b361a45c50b8bab25d4436 (patch) | |
tree | 398c393f7f07dc7c387e33bbef1b6e8cc754a653 | |
parent | 15ead5db872ddc1d6f450a58503bea8aa6eaea99 (diff) | |
download | gsoc2013-evolution-84d1cc73e2b9765b02b361a45c50b8bab25d4436.tar.gz gsoc2013-evolution-84d1cc73e2b9765b02b361a45c50b8bab25d4436.tar.zst gsoc2013-evolution-84d1cc73e2b9765b02b361a45c50b8bab25d4436.zip |
Bug #603469 - Crash in contacts-map with no Home address filled
There was some confusion between the query using E_CONTACT_ADDRESS and
the address used. Now the first of the following is shown in the map:
Home, Work, Other.
-rw-r--r-- | plugins/contacts-map/contacts-map.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/contacts-map/contacts-map.c b/plugins/contacts-map/contacts-map.c index afde8e2273..be3f9b1ff9 100644 --- a/plugins/contacts-map/contacts-map.c +++ b/plugins/contacts-map/contacts-map.c @@ -142,11 +142,23 @@ show_map_general (ESourceSelector *selector) EContact *contact; EContactAddress *addr; GHashTable *details; + gint i; + const gint addr_fields[] = { + E_CONTACT_ADDRESS_HOME, + E_CONTACT_ADDRESS_WORK, + E_CONTACT_ADDRESS_OTHER + }; contact = tmp->data; /* Get the lat & lng and add the marker asynchronously */ - addr = e_contact_get (contact, E_CONTACT_ADDRESS_HOME); + i = 0; + addr = NULL; + while (!addr && i<G_N_ELEMENTS(addr_fields)) { + addr = e_contact_get(contact, addr_fields[i]); + i++; + } + details = (GHashTable*) get_geoclue_from_address (addr); fields = geoclue_geocode_address_to_position (geocoder, details, &lat, &lng, NULL, &accuracy, &error); |