actually implement location bluring
[azimuth] / src / azimuth.c
index 392805c..712ea9d 100644 (file)
@@ -68,6 +68,21 @@ update_gps (Azimuth *self)
 }
 
 static void
+update_blur (Azimuth *self)
+{
+  AzimuthPrivate *priv = AZIMUTH_GET_PRIVATE (self);
+  gboolean blur;
+
+  if (priv->publisher == NULL)
+    return;
+
+  blur = gconf_client_get_bool (priv->gconf,
+      AZIMUTH_GCONF_KEY_BLUR, NULL);
+
+  position_publisher_set_blur (priv->publisher, blur);
+}
+
+static void
 enabled_changed (Azimuth *self,
     gboolean enabled)
 {
@@ -79,7 +94,9 @@ enabled_changed (Azimuth *self,
         return;
 
       g_print ("enable publishing\n");
-      priv->publisher = position_publisher_new (TRUE);
+      priv->publisher = position_publisher_new ();
+
+      update_blur (self);
     }
   else
     {
@@ -112,11 +129,17 @@ gconf_notification_cb (GConfClient *client,
       enabled_changed (self, enabled);
     }
 
-  if (!tp_strdiff (key, AZIMUTH_GCONF_KEY_START_GPS) &&
+  else if (!tp_strdiff (key, AZIMUTH_GCONF_KEY_START_GPS) &&
       value->type == GCONF_VALUE_BOOL)
     {
       update_gps (self);
     }
+
+  else if (!tp_strdiff (key, AZIMUTH_GCONF_KEY_BLUR) &&
+      value->type == GCONF_VALUE_BOOL)
+    {
+      update_blur (self);
+    }
 }
 
 static void
@@ -208,9 +231,10 @@ azimuth_run (Azimuth *self)
     {
       g_print ("publishing is enabled\n");
       g_assert (priv->publisher == NULL);
-      priv->publisher = position_publisher_new (TRUE);
+      priv->publisher = position_publisher_new ();
 
       update_gps (self);
+      update_blur (self);
     }
   else
     {