[empathy] location-manager: use geoclue_master_create_client_async()
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] location-manager: use geoclue_master_create_client_async()
- Date: Thu, 15 Mar 2012 07:52:37 +0000 (UTC)
commit 4bfb1d6bf59735b088e3daae5158203454fd23ba
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Wed Mar 14 15:42:05 2012 +0100
location-manager: use geoclue_master_create_client_async()
https://bugzilla.gnome.org/show_bug.cgi?id=671994
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 94df278..53f25d6 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]