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 | 4bfb1d6bf59735b088e3daae5158203454fd23ba (patch) | |
tree | 0c0d0c414c1c2e15b9e8fc14a8b6e76c78e5d61e /libempathy-gtk/empathy-location-manager.c | |
parent | f2d951772c8d1d00b7159dc8942c7593c476f29b (diff) | |
download | gsoc2013-empathy-4bfb1d6bf59735b088e3daae5158203454fd23ba.tar gsoc2013-empathy-4bfb1d6bf59735b088e3daae5158203454fd23ba.tar.gz gsoc2013-empathy-4bfb1d6bf59735b088e3daae5158203454fd23ba.tar.bz2 gsoc2013-empathy-4bfb1d6bf59735b088e3daae5158203454fd23ba.tar.lz gsoc2013-empathy-4bfb1d6bf59735b088e3daae5158203454fd23ba.tar.xz gsoc2013-empathy-4bfb1d6bf59735b088e3daae5158203454fd23ba.tar.zst gsoc2013-empathy-4bfb1d6bf59735b088e3daae5158203454fd23ba.zip |
location-manager: use geoclue_master_create_client_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.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c index 94df27835..53f25d6dc 100644 --- a/libempathy-gtk/empathy-location-manager.c +++ b/libempathy-gtk/empathy-location-manager.c @@ -471,24 +471,25 @@ update_resources (EmpathyLocationManager *self) } static void -setup_geoclue (EmpathyLocationManager *self) +create_client_cb (GeoclueMaster *master, + GeoclueMasterClient *client, + char *object_path, + GError *error, + gpointer userdata) { - GeoclueMaster *master; - GError *error = NULL; - - DEBUG ("Setting up Geoclue"); - master = geoclue_master_get_default (); - self->priv->gc_client = geoclue_master_create_client (master, NULL, &error); - g_object_unref (master); + EmpathyLocationManager *self = userdata; - if (self->priv->gc_client == NULL) + if (error != NULL) { - DEBUG ("Failed to GeoclueMasterClient: %s", error->message); - g_error_free (error); + DEBUG ("Failed to create GeoclueMasterClient: %s", error->message); return; } - if (!set_requirements (self)) + /* @client seems be (transfer full) looking at the geoclue code; yeah for + * undocumented API... */ + self->priv->gc_client = client; + + if (!set_requirements (self)) return; /* Get updated when the position is changes */ @@ -518,9 +519,23 @@ setup_geoclue (EmpathyLocationManager *self) G_CALLBACK (address_changed_cb), self); self->priv->geoclue_is_setup = TRUE; + } static void +setup_geoclue (EmpathyLocationManager *self) +{ + GeoclueMaster *master; + + DEBUG ("Setting up Geoclue"); + master = geoclue_master_get_default (); + + geoclue_master_create_client_async (master, create_client_cb, self); + + g_object_unref (master); + } + +static void publish_cb (GSettings *gsettings_loc, const gchar *key, gpointer user_data) |