factor out create_publisher
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 1 Jun 2010 16:45:40 +0000 (18:45 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 1 Jun 2010 16:45:40 +0000 (18:45 +0200)
src/azimuth.c

index 712ea9d..06daa08 100644 (file)
@@ -83,6 +83,14 @@ update_blur (Azimuth *self)
 }
 
 static void
+create_publisher (Azimuth *self)
+{
+  AzimuthPrivate *priv = AZIMUTH_GET_PRIVATE (self);
+
+  priv->publisher = position_publisher_new ();
+}
+
+static void
 enabled_changed (Azimuth *self,
     gboolean enabled)
 {
@@ -94,7 +102,7 @@ enabled_changed (Azimuth *self,
         return;
 
       g_print ("enable publishing\n");
-      priv->publisher = position_publisher_new ();
+      create_publisher (self);
 
       update_blur (self);
     }
@@ -231,7 +239,7 @@ azimuth_run (Azimuth *self)
     {
       g_print ("publishing is enabled\n");
       g_assert (priv->publisher == NULL);
-      priv->publisher = position_publisher_new ();
+      create_publisher (self);
 
       update_gps (self);
       update_blur (self);