update to geocode-glib-3.18.0
This commit is contained in:
parent
f61488d6c4
commit
e0ab4e41fe
@ -1,10 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.14 2015/05/27 13:40:50 ajacoutot Exp $
|
||||
# $OpenBSD: Makefile,v 1.15 2015/10/03 14:52:09 jasper Exp $
|
||||
|
||||
COMMENT= convenience library for the geocoding
|
||||
|
||||
GNOME_VERSION= 3.16.2
|
||||
GNOME_VERSION= 3.18.0
|
||||
GNOME_PROJECT= geocode-glib
|
||||
REVISION= 0
|
||||
|
||||
SHARED_LIBS += geocode-glib 0.0 # 0.0
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (geocode-glib-3.16.2.tar.xz) = pVH/29eT1UoU5wnJ0C6C3eOrwU7tgGWrrZInWkP+LJc=
|
||||
SIZE (geocode-glib-3.16.2.tar.xz) = 355424
|
||||
SHA256 (geocode-glib-3.18.0.tar.xz) = j7fw1Wnj5mlqqh/fJ1yzCUUn7F6fo2/YjdYz3+xjSV0=
|
||||
SIZE (geocode-glib-3.18.0.tar.xz) = 357560
|
||||
|
@ -1,73 +0,0 @@
|
||||
$OpenBSD: patch-geocode-glib_geocode-reverse_c,v 1.1 2015/05/27 13:40:50 ajacoutot Exp $
|
||||
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=749963
|
||||
|
||||
--- geocode-glib/geocode-reverse.c.orig Wed Apr 22 22:32:40 2015
|
||||
+++ geocode-glib/geocode-reverse.c Wed May 27 15:35:49 2015
|
||||
@@ -114,6 +114,30 @@ geocode_reverse_new_for_location (GeocodeLocation *loc
|
||||
return object;
|
||||
}
|
||||
|
||||
+static void
|
||||
+insert_bounding_box_element (GHashTable *ht,
|
||||
+ GType value_type,
|
||||
+ const char *name,
|
||||
+ JsonReader *reader)
|
||||
+{
|
||||
+ if (value_type == G_TYPE_STRING) {
|
||||
+ const char *bbox_val;
|
||||
+
|
||||
+ bbox_val = json_reader_get_string_value (reader);
|
||||
+ g_hash_table_insert(ht, g_strdup (name), g_strdup (bbox_val));
|
||||
+ json_reader_end_element (reader);
|
||||
+ } else if (value_type == G_TYPE_DOUBLE) {
|
||||
+ gdouble bbox_val;
|
||||
+
|
||||
+ bbox_val = json_reader_get_double_value (reader);
|
||||
+ g_hash_table_insert(ht, g_strdup (name), g_strdup_printf ("%lf", bbox_val));
|
||||
+ json_reader_end_element (reader);
|
||||
+ } else {
|
||||
+ g_debug ("Unhandled node type %s for %s", g_type_name (value_type), name);
|
||||
+ json_reader_end_element (reader);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void
|
||||
_geocode_read_nominatim_attributes (JsonReader *reader,
|
||||
GHashTable *ht)
|
||||
@@ -168,26 +192,23 @@ _geocode_read_nominatim_attributes (JsonReader *reader
|
||||
}
|
||||
} else if (g_strcmp0 (members[i], "boundingbox") == 0) {
|
||||
const char *bbox_val;
|
||||
+ JsonNode *node;
|
||||
+ GType value_type;
|
||||
|
||||
json_reader_read_element (reader, 0);
|
||||
- bbox_val = json_reader_get_string_value (reader);
|
||||
- g_hash_table_insert(ht, g_strdup ("boundingbox-bottom"), g_strdup (bbox_val));
|
||||
- json_reader_end_element (reader);
|
||||
+ node = json_reader_get_value (reader);
|
||||
+ value_type = json_node_get_value_type (node);
|
||||
|
||||
+ insert_bounding_box_element (ht, value_type, "boundingbox-bottom", reader);
|
||||
+
|
||||
json_reader_read_element (reader, 1);
|
||||
- bbox_val = json_reader_get_string_value (reader);
|
||||
- g_hash_table_insert(ht, g_strdup ("boundingbox-top"), g_strdup (bbox_val));
|
||||
- json_reader_end_element (reader);
|
||||
+ insert_bounding_box_element (ht, value_type, "boundingbox-top", reader);
|
||||
|
||||
json_reader_read_element (reader, 2);
|
||||
- bbox_val = json_reader_get_string_value (reader);
|
||||
- g_hash_table_insert(ht, g_strdup ("boundingbox-left"), g_strdup (bbox_val));
|
||||
- json_reader_end_element (reader);
|
||||
+ insert_bounding_box_element (ht, value_type, "boundingbox-left", reader);
|
||||
|
||||
json_reader_read_element (reader, 3);
|
||||
- bbox_val = json_reader_get_string_value (reader);
|
||||
- g_hash_table_insert(ht, g_strdup ("boundingbox-right"), g_strdup (bbox_val));
|
||||
- json_reader_end_element (reader);
|
||||
+ insert_bounding_box_element (ht, value_type, "boundingbox-right", reader);
|
||||
}
|
||||
json_reader_end_member (reader);
|
||||
}
|
Loading…
Reference in New Issue
Block a user