aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-location-manager.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-14 22:42:05 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-15 15:48:47 +0800
commitd6edab79ba1b0f8037f6c42e92ef98b0cdaaa843 (patch)
tree3eed50bccddc154ae30875c1211a38501ec80c80 /libempathy-gtk/empathy-location-manager.c
parent3c6503936ec6703ef4c421d4ef3f30d140c4e114 (diff)
downloadgsoc2013-empathy-d6edab79ba1b0f8037f6c42e92ef98b0cdaaa843.tar
gsoc2013-empathy-d6edab79ba1b0f8037f6c42e92ef98b0cdaaa843.tar.gz
gsoc2013-empathy-d6edab79ba1b0f8037f6c42e92ef98b0cdaaa843.tar.bz2
gsoc2013-empathy-d6edab79ba1b0f8037f6c42e92ef98b0cdaaa843.tar.lz
gsoc2013-empathy-d6edab79ba1b0f8037f6c42e92ef98b0cdaaa843.tar.xz
gsoc2013-empathy-d6edab79ba1b0f8037f6c42e92ef98b0cdaaa843.tar.zst
gsoc2013-empathy-d6edab79ba1b0f8037f6c42e92ef98b0cdaaa843.zip
location-manager: use geoclue_master_client_create_address_async()
https://bugzilla.gnome.org/show_bug.cgi?id=671994
Diffstat (limited to 'libempathy-gtk/empathy-location-manager.c')
-rw-r--r--libempathy-gtk/empathy-location-manager.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c
index 9c72d3010..22b2c2362 100644
--- a/libempathy-gtk/empathy-location-manager.c
+++ b/libempathy-gtk/empathy-location-manager.c
@@ -476,6 +476,28 @@ update_resources (EmpathyLocationManager *self)
}
static void
+create_address_cb (GeoclueMasterClient *client,
+ GeoclueAddress *address,
+ GError *error,
+ gpointer userdata)
+{
+ EmpathyLocationManager *self = userdata;
+
+ if (error != NULL)
+ {
+ DEBUG ("Failed to create GeoclueAddress: %s", error->message);
+ return;
+ }
+
+ self->priv->gc_address = address;
+
+ g_signal_connect (G_OBJECT (self->priv->gc_address), "address-changed",
+ G_CALLBACK (address_changed_cb), self);
+
+ self->priv->geoclue_is_setup = TRUE;
+}
+
+static void
create_position_cb (GeoclueMasterClient *client,
GeocluePosition *position,
GError *error,
@@ -495,19 +517,8 @@ create_position_cb (GeoclueMasterClient *client,
G_CALLBACK (position_changed_cb), self);
/* Get updated when the address changes */
- self->priv->gc_address = geoclue_master_client_create_address (
- self->priv->gc_client, &error);
- if (self->priv->gc_address == NULL)
- {
- DEBUG ("Failed to create GeoclueAddress: %s", error->message);
- g_error_free (error);
- return;
- }
-
- g_signal_connect (G_OBJECT (self->priv->gc_address), "address-changed",
- G_CALLBACK (address_changed_cb), self);
-
- self->priv->geoclue_is_setup = TRUE;
+ geoclue_master_client_create_address_async (self->priv->gc_client,
+ create_address_cb, self);
}
static void