After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727861 - Add extension to set name of location from geo uri
Add extension to set name of location from geo uri
Status: RESOLVED FIXED
Product: geocode-glib
Classification: Other
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: geocode-glib maintainer(s)
geocode-glib maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-04-08 20:27 UTC by Jonas Danielsson
Modified: 2014-05-14 12:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
forward: Add description extension to geo uri (4.55 KB, patch)
2014-04-08 20:28 UTC, Jonas Danielsson
none Details | Review
forward: Document geo URI scheme usage (1.01 KB, patch)
2014-04-08 20:28 UTC, Jonas Danielsson
needs-work Details | Review
forward: Add description extension to geo uri (3.82 KB, patch)
2014-04-09 10:07 UTC, Jonas Danielsson
committed Details | Review
forward: fix memory leaks (1.61 KB, patch)
2014-05-08 10:19 UTC, Jonas Danielsson
committed Details | Review
test-geouri: fix memory leaks (985 bytes, patch)
2014-05-08 10:19 UTC, Jonas Danielsson
committed Details | Review
forward: Document geo URI scheme usage (1.15 KB, patch)
2014-05-14 11:57 UTC, Jonas Danielsson
committed Details | Review

Description Jonas Danielsson 2014-04-08 20:27:19 UTC
Android and Google Maps uses "geo:0,0?q=lat,lng(label)" to specify a description to a location.

We could use the same in geocode-glib.
Comment 1 Jonas Danielsson 2014-04-08 20:28:14 UTC
Created attachment 273834 [details] [review]
forward: Add description extension to geo uri

Android and Google Maps support an extention to geo uri that allows
specifying a label to a location.

The form is
    geo:0,0?q=lat,lng(label)

This patch adds parsing of that format to GeocodeLocation.
Comment 2 Jonas Danielsson 2014-04-08 20:28:17 UTC
Created attachment 273835 [details] [review]
forward: Document geo URI scheme usage
Comment 3 Jonas Danielsson 2014-04-09 10:07:12 UTC
Created attachment 273875 [details] [review]
forward: Add description extension to geo uri

Android and Google Maps support an extention to geo uri that allows
specifying a label to a location.

The form is
    geo:0,0?q=lat,lng(label)

This patch adds parsing of that format to GeocodeLocation.
Comment 4 Bastien Nocera 2014-05-07 20:50:30 UTC
Review of attachment 273875 [details] [review]:

If this is valgrind clean in the tests, it looks good to commit when those comments are fixed.

::: geocode-glib/geocode-location.c
@@ +215,3 @@
+        int max_description_len = 512;
+
+        if (loc->priv->latitude != 0 || loc->priv->longitude != 0) {

Did we really use braces for one-line conditionals?

@@ +242,3 @@
+                goto err;
+        }
+        description_len = MIN (token_end - next_token, max_description_len);

I don't like that. What is it trying to protect? If params is already overly long, I don't think there's much of a point truncating it.
Comment 5 Jonas Danielsson 2014-05-08 10:19:00 UTC
Created attachment 276146 [details] [review]
forward: fix memory leaks
Comment 6 Jonas Danielsson 2014-05-08 10:19:03 UTC
Created attachment 276147 [details] [review]
test-geouri: fix memory leaks
Comment 7 Jonas Danielsson 2014-05-08 10:20:10 UTC
Review of attachment 273875 [details] [review]:

I have fixed up the commits below and made sure it is valgrind clean.

While doing so I discovered memory leaks that the patches above addresses.
Those might be candidates for 3.12 as well.
Comment 8 Jonas Danielsson 2014-05-08 10:20:30 UTC
Any comments on the documentation patch?
Comment 9 Bastien Nocera 2014-05-09 13:52:35 UTC
Review of attachment 273835 [details] [review]:

::: geocode-glib/geocode-location.c
@@ +655,3 @@
+ * An extension to set a description is also supported in the form of:
+ *
+ * - geo:0,0?q=latitude,longitude(description)

A link to a reference site explaining where this extension comes from would be appreciated.
Comment 10 Bastien Nocera 2014-05-09 13:53:25 UTC
Review of attachment 276146 [details] [review]:

Looks good
Comment 11 Bastien Nocera 2014-05-09 13:53:43 UTC
Review of attachment 276147 [details] [review]:

Looks good
Comment 12 Jonas Danielsson 2014-05-09 19:04:16 UTC
Review of attachment 273835 [details] [review]:

Yeah, the only reference site I can find is the android one at:

http://developer.android.com/guide/components/intents-common.html#Maps

You think we should include that?
Comment 13 Jonas Danielsson 2014-05-09 19:05:39 UTC
Comment on attachment 273875 [details] [review]
forward: Add description extension to geo uri

Attachment 273875 [details] pushed as 931bd04 - forward: Add description extension to geo uri
Comment 14 Jonas Danielsson 2014-05-09 19:06:39 UTC
Attachment 276146 [details] pushed as a7fb78e - forward: fix memory leaks
Attachment 276147 [details] pushed as 227618c - test-geouri: fix memory leaks
Comment 15 Jonas Danielsson 2014-05-14 11:57:20 UTC
Created attachment 276523 [details] [review]
forward: Document geo URI scheme usage
Comment 16 Bastien Nocera 2014-05-14 12:04:50 UTC
Review of attachment 276523 [details] [review]:

Looks fine to commit after that change.

::: geocode-glib/geocode-location.c
@@ +658,3 @@
+ * - geo:0,0?q=latitude,longitude(description)
+ *
+ * It comes from the Android world and is documented <ulink url="http://developer.android.com/guide/components/intents-common.html#Maps">here.</ulink>

No need for that sentence here.

Above, you'd have:
An <ulink url="http://developer.android.com/guide/components/intents-common.html#Maps">Android extension</ulink> to set a description is also supported in the form of:
Comment 17 Jonas Danielsson 2014-05-14 12:14:16 UTC
Attachment 276523 [details] pushed as 538e625 - forward: Document geo URI scheme usage