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 599162 - Should use TpContact get Location
Should use TpContact get Location
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Geolocation
2.28.x
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-21 10:38 UTC by Guillaume Desmottes
Modified: 2010-04-06 17:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/location-tp-contact-599162 (15.67 KB, patch)
2010-04-05 11:18 UTC, Guillaume Desmottes
reviewed Details | Review

Description Guillaume Desmottes 2009-10-21 10:38:43 UTC
Once TpContact supports Location ( https://bugs.freedesktop.org/show_bug.cgi?id=24652 ) Empathy should use it instead of manually request the location.
Comment 1 Guillaume Desmottes 2010-04-05 11:18:27 UTC
Created attachment 157964 [details] [review]
http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/location-tp-contact-599162

 libempathy/empathy-contact.c            |  179 +++++++++++++++++++++++-
 libempathy/empathy-contact.h            |    2 -
 libempathy/empathy-tp-contact-factory.c |  231 +------------------------------
 3 files changed, 178 insertions(+), 234 deletions(-)
Comment 2 Guillaume Desmottes 2010-04-05 11:19:28 UTC
This branch is blocked by https://bugs.freedesktop.org/show_bug.cgi?id=24652
Comment 3 Cosimo Cecchi 2010-04-06 15:37:25 UTC
Review of attachment 157964 [details] [review]:

Hi, I inlined some comments below (mostly style fixes).

::: libempathy/empathy-contact.c
@@ +1164,2 @@
   priv->location = g_hash_table_ref (location);
+  update_geocode (contact);

You could #ifdef this call here and use a single #ifdef HAVE_GEOCLUE later.

@@ +1215,3 @@
+geocode_cb (GeoclueGeocode *geocode,
+	    GeocluePositionFields fields,
+	    double latitude,

EmpathyContact already uses mixed styles for indentation, but we should probably use the new style for added code in these functions here.

@@ +1219,3 @@
+	    double altitude,
+	    GeoclueAccuracy *accuracy,
+	    GError *error,

If the error really belongs to Geoclue here, this should probably say const GError* <nitpick/>.

@@ +1348,3 @@
+		geocode_cb, contact);
+
+	g_hash_table_unref (address);

Does geoclue assume a ref to the hash table? If so, you could probably add a comment here.
Comment 4 Guillaume Desmottes 2010-04-06 16:20:54 UTC
Review of attachment 157964 [details] [review]:

::: libempathy/empathy-contact.c
@@ +1164,2 @@
   priv->location = g_hash_table_ref (location);
+  update_geocode (contact);

Done.

@@ +1215,3 @@
+geocode_cb (GeoclueGeocode *geocode,
+	    GeocluePositionFields fields,
+	    double latitude,

Very good point; fixed.

@@ +1219,3 @@
+	    double altitude,
+	    GeoclueAccuracy *accuracy,
+	    GError *error,

Yeah, geoclue's API is wrong here.

@@ +1348,3 @@
+		geocode_cb, contact);
+
+	g_hash_table_unref (address);

I don't understand this comment. Geoclue pass the hash table to dbus-glib which does all its black magic.
Comment 5 Cosimo Cecchi 2010-04-06 16:39:03 UTC
(In reply to comment #4)

> I don't understand this comment. Geoclue pass the hash table to dbus-glib which
> does all its black magic.

It just felt strange to unref the hash table after passing it to a method, as if it was a GObject, feel free to ignore that comment :)

The latest version of the branch looks good to me.
Comment 6 Guillaume Desmottes 2010-04-06 17:02:58 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.