From: Guillaume Desmottes Date: Tue, 1 Jun 2010 16:45:40 +0000 (+0200) Subject: factor out create_publisher X-Git-Tag: azimuth-0.3~2 X-Git-Url: https://vcs.maemo.org/git/?p=azimuth;a=commitdiff_plain;h=e8cb4c4168b30ab8ce3ce7ab9962a2546b789c20 factor out create_publisher --- diff --git a/src/azimuth.c b/src/azimuth.c index 712ea9d..06daa08 100644 --- a/src/azimuth.c +++ b/src/azimuth.c @@ -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);