Michael Catanzaro 12a10e3
From f1b1b75e6772502290cbff5be2c8f31b61bdb6df Mon Sep 17 00:00:00 2001
Michael Catanzaro 12a10e3
From: Fabrice Bellet <fabrice@bellet.info>
Michael Catanzaro 12a10e3
Date: Mon, 23 Mar 2015 01:30:50 +0100
Michael Catanzaro 12a10e3
Subject: [PATCH] location-manager: fix reduce accuracy setting
Michael Catanzaro 12a10e3
Michael Catanzaro 12a10e3
https://bugzilla.gnome.org/show_bug.cgi?id=746735
Michael Catanzaro 12a10e3
---
Michael Catanzaro 12a10e3
 libempathy-gtk/empathy-location-manager.c | 17 +++++++++++++++++
Michael Catanzaro 12a10e3
 1 file changed, 17 insertions(+)
Michael Catanzaro 12a10e3
Michael Catanzaro 12a10e3
diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c
Michael Catanzaro 12a10e3
index 8787eb2..6ba39ac 100644
Michael Catanzaro 12a10e3
--- a/libempathy-gtk/empathy-location-manager.c
Michael Catanzaro 12a10e3
+++ b/libempathy-gtk/empathy-location-manager.c
Michael Catanzaro 12a10e3
@@ -368,6 +368,18 @@ publish_cb (GSettings *gsettings_loc,
Michael Catanzaro 12a10e3
 }
Michael Catanzaro 12a10e3
 
Michael Catanzaro 12a10e3
 static void
Michael Catanzaro 12a10e3
+reduce_accuracy_cb (GSettings *gsettings_loc,
Michael Catanzaro 12a10e3
+                    const gchar *key,
Michael Catanzaro 12a10e3
+                    gpointer user_data)
Michael Catanzaro 12a10e3
+{
Michael Catanzaro 12a10e3
+  EmpathyLocationManager *self = EMPATHY_LOCATION_MANAGER (user_data);
Michael Catanzaro 12a10e3
+
Michael Catanzaro 12a10e3
+  DEBUG ("Reduce Accuracy changed");
Michael Catanzaro 12a10e3
+
Michael Catanzaro 12a10e3
+  self->priv->reduce_accuracy = g_settings_get_boolean (gsettings_loc, key);
Michael Catanzaro 12a10e3
+}
Michael Catanzaro 12a10e3
+
Michael Catanzaro 12a10e3
+static void
Michael Catanzaro 12a10e3
 account_manager_prepared_cb (GObject *source_object,
Michael Catanzaro 12a10e3
     GAsyncResult *result,
Michael Catanzaro 12a10e3
     gpointer user_data)
Michael Catanzaro 12a10e3
@@ -416,7 +428,12 @@ empathy_location_manager_init (EmpathyLocationManager *self)
Michael Catanzaro 12a10e3
       "changed::" EMPATHY_PREFS_LOCATION_PUBLISH,
Michael Catanzaro 12a10e3
       G_CALLBACK (publish_cb), self);
Michael Catanzaro 12a10e3
 
Michael Catanzaro 12a10e3
+  g_signal_connect (priv->gsettings_loc,
Michael Catanzaro 12a10e3
+      "changed::" EMPATHY_PREFS_LOCATION_REDUCE_ACCURACY,
Michael Catanzaro 12a10e3
+      G_CALLBACK (reduce_accuracy_cb), self);
Michael Catanzaro 12a10e3
+
Michael Catanzaro 12a10e3
   publish_cb (priv->gsettings_loc, EMPATHY_PREFS_LOCATION_PUBLISH, self);
Michael Catanzaro 12a10e3
+  reduce_accuracy_cb (priv->gsettings_loc, EMPATHY_PREFS_LOCATION_REDUCE_ACCURACY, self);
Michael Catanzaro 12a10e3
 }
Michael Catanzaro 12a10e3
 
Michael Catanzaro 12a10e3
 EmpathyLocationManager *