diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-03-14 22:42:05 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-03-15 15:48:47 +0800 |
commit | 3c6503936ec6703ef4c421d4ef3f30d140c4e114 (patch) | |
tree | 4d788ab5de1f8e11268399b0f7394fadab21d965 | |
parent | 8eb401d562b29f195d68ca04e3dfbf8adc501846 (diff) | |
download | gsoc2013-empathy-3c6503936ec6703ef4c421d4ef3f30d140c4e114.tar gsoc2013-empathy-3c6503936ec6703ef4c421d4ef3f30d140c4e114.tar.gz gsoc2013-empathy-3c6503936ec6703ef4c421d4ef3f30d140c4e114.tar.bz2 gsoc2013-empathy-3c6503936ec6703ef4c421d4ef3f30d140c4e114.tar.lz gsoc2013-empathy-3c6503936ec6703ef4c421d4ef3f30d140c4e114.tar.xz gsoc2013-empathy-3c6503936ec6703ef4c421d4ef3f30d140c4e114.tar.zst gsoc2013-empathy-3c6503936ec6703ef4c421d4ef3f30d140c4e114.zip |
location-manager: use geoclue_master_client_create_position_async()
https://bugzilla.gnome.org/show_bug.cgi?id=671994
-rw-r--r-- | libempathy-gtk/empathy-location-manager.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c index ec7810f7d..9c72d3010 100644 --- a/libempathy-gtk/empathy-location-manager.c +++ b/libempathy-gtk/empathy-location-manager.c @@ -476,7 +476,8 @@ update_resources (EmpathyLocationManager *self) } static void -create_client_set_requirements_cb (GeoclueMasterClient *client, +create_position_cb (GeoclueMasterClient *client, + GeocluePosition *position, GError *error, gpointer userdata) { @@ -484,20 +485,12 @@ create_client_set_requirements_cb (GeoclueMasterClient *client, if (error != NULL) { - DEBUG ("set_requirements failed: %s", error->message); - return; - } - - /* Get updated when the position is changes */ - self->priv->gc_position = geoclue_master_client_create_position ( - self->priv->gc_client, &error); - if (self->priv->gc_position == NULL) - { DEBUG ("Failed to create GeocluePosition: %s", error->message); - g_error_free (error); return; } + self->priv->gc_position = position; + g_signal_connect (G_OBJECT (self->priv->gc_position), "position-changed", G_CALLBACK (position_changed_cb), self); @@ -518,6 +511,25 @@ create_client_set_requirements_cb (GeoclueMasterClient *client, } static void +create_client_set_requirements_cb (GeoclueMasterClient *client, + GError *error, + gpointer userdata) +{ + EmpathyLocationManager *self = userdata; + + if (error != NULL) + { + DEBUG ("set_requirements failed: %s", error->message); + g_error_free (error); + return; + } + + /* Get updated when the position is changes */ + geoclue_master_client_create_position_async (self->priv->gc_client, + create_position_cb, self); +} + +static void create_client_cb (GeoclueMaster *master, GeoclueMasterClient *client, char *object_path, |