[gnome-maps] maps-contact: Check for no street address
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] maps-contact: Check for no street address
- Date: Wed, 14 Oct 2015 17:21:16 +0000 (UTC)
commit 64a5e3d2ed708ee346c0fd504f99be859d015229
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Tue Oct 13 20:24:46 2015 +0200
maps-contact: Check for no street address
Make sure we do not try to add a street if the geocoding
does not produce one.
https://bugzilla.gnome.org/show_bug.cgi?id=756509
lib/maps-contact.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/lib/maps-contact.c b/lib/maps-contact.c
index e26a744..a842a5a 100644
--- a/lib/maps-contact.c
+++ b/lib/maps-contact.c
@@ -264,6 +264,7 @@ on_geocode_search_async (GeocodeForward *forward,
GeocodePlace *place = g_list_nth_data (places, 0);
GeocodeLocation *location = geocode_place_get_location (place);
const char *street_address;
+ const char *street;
/* Keep the naming, but add location and osm info */
geocode_place_set_location (data->place, location);
@@ -282,10 +283,11 @@ on_geocode_search_async (GeocodeForward *forward,
/* Make sure we do not lie about how good our resolution is */
street_address = geocode_place_get_street_address (place);
+ street = geocode_place_get_street (place);
if (street_address)
- geocode_place_set_street_address (data->place, street_address);
- else
- geocode_place_set_street (data->place, geocode_place_get_street (place));
+ geocode_place_set_street_address (data->place, street);
+ else if (street)
+ geocode_place_set_street (data->place, street);
g_list_free_full(places, g_object_unref);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]