aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-contact-factory.c
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>2009-07-01 00:35:55 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-07-01 05:52:19 +0800
commita980a2b3eaa634981b0ebfe950f50b515e43cf4a (patch)
tree7148029c207022a86202f64d3d2647c6818c49cb /libempathy/empathy-tp-contact-factory.c
parent66b32d43ebeab870039ca729b24ae64fdeff5088 (diff)
downloadgsoc2013-empathy-a980a2b3eaa634981b0ebfe950f50b515e43cf4a.tar
gsoc2013-empathy-a980a2b3eaa634981b0ebfe950f50b515e43cf4a.tar.gz
gsoc2013-empathy-a980a2b3eaa634981b0ebfe950f50b515e43cf4a.tar.bz2
gsoc2013-empathy-a980a2b3eaa634981b0ebfe950f50b515e43cf4a.tar.lz
gsoc2013-empathy-a980a2b3eaa634981b0ebfe950f50b515e43cf4a.tar.xz
gsoc2013-empathy-a980a2b3eaa634981b0ebfe950f50b515e43cf4a.tar.zst
gsoc2013-empathy-a980a2b3eaa634981b0ebfe950f50b515e43cf4a.zip
Improve geocoding debugging and add more fields
Diffstat (limited to 'libempathy/empathy-tp-contact-factory.c')
-rw-r--r--libempathy/empathy-tp-contact-factory.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c
index 96fdfda68..27160a445 100644
--- a/libempathy/empathy-tp-contact-factory.c
+++ b/libempathy/empathy-tp-contact-factory.c
@@ -494,21 +494,47 @@ tp_contact_factory_geocode (EmpathyContact *contact)
address = geoclue_address_details_new ();
+ str = get_dup_string (location, EMPATHY_LOCATION_COUNTRY_CODE);
+ if (str != NULL) {
+ g_hash_table_insert (address,
+ g_strdup (GEOCLUE_ADDRESS_KEY_COUNTRYCODE), str);
+ DEBUG ("\t - countrycode: %s", str);
+ }
+
str = get_dup_string (location, EMPATHY_LOCATION_COUNTRY);
- if (str != NULL)
- g_hash_table_insert (address, g_strdup ("country"), str);
+ if (str != NULL) {
+ g_hash_table_insert (address,
+ g_strdup (GEOCLUE_ADDRESS_KEY_COUNTRY), str);
+ DEBUG ("\t - country: %s", str);
+ }
str = get_dup_string (location, EMPATHY_LOCATION_POSTAL_CODE);
- if (str != NULL)
- g_hash_table_insert (address, g_strdup ("postalcode"), str);
+ if (str != NULL) {
+ g_hash_table_insert (address,
+ g_strdup (GEOCLUE_ADDRESS_KEY_POSTALCODE), str);
+ DEBUG ("\t - postalcode: %s", str);
+ }
+
+ str = get_dup_string (location, EMPATHY_LOCATION_REGION);
+ if (str != NULL) {
+ g_hash_table_insert (address,
+ g_strdup (GEOCLUE_ADDRESS_KEY_REGION), str);
+ DEBUG ("\t - region: %s", str);
+ }
str = get_dup_string (location, EMPATHY_LOCATION_LOCALITY);
- if (str != NULL)
- g_hash_table_insert (address, g_strdup ("locality"), str);
+ if (str != NULL) {
+ g_hash_table_insert (address,
+ g_strdup (GEOCLUE_ADDRESS_KEY_LOCALITY), str);
+ DEBUG ("\t - locality: %s", str);
+ }
str = get_dup_string (location, EMPATHY_LOCATION_STREET);
- if (str != NULL)
- g_hash_table_insert (address, g_strdup ("street"), str);
+ if (str != NULL) {
+ g_hash_table_insert (address,
+ g_strdup (GEOCLUE_ADDRESS_KEY_STREET), str);
+ DEBUG ("\t - street: %s", str);
+ }
g_object_ref (contact);
geoclue_geocode_address_to_position_async (geocode, address,