]> err.no Git - libchamplain/commitdiff
Don't ues deprecated signals and fix a random bug
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 3 Feb 2009 20:35:33 +0000 (22:35 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 3 Feb 2009 20:35:33 +0000 (22:35 +0200)
where the last inserted marker won't show until zoom changes
because the actor is not yet into the foreach call...

champlain/champlain-view.c

index e0197e6d42b40f1905fbcb054032b33b1b69f9f6..22c05b42d9df7529832012b31cb0ff66e7502f61 100644 (file)
@@ -295,7 +295,7 @@ layer_add_marker_cb (ClutterGroup *layer,
   g_signal_connect (marker, "notify::longitude",
       G_CALLBACK (notify_marker_reposition_cb), view);
 
-  marker_reposition (view);
+  g_idle_add (marker_reposition, view);
 }
 
 static void
@@ -331,7 +331,7 @@ create_initial_map (ChamplainView *view)
   clutter_container_add_actor (CLUTTER_CONTAINER (priv->map_layer),
       priv->map->current_level->group);
 
-  marker_reposition (view);
+  g_idle_add (marker_reposition, view);
   update_license (view);
 
   g_object_notify (G_OBJECT (view), "zoom-level");
@@ -540,7 +540,7 @@ champlain_view_set_property (GObject *object,
                   priv->map->current_level->group);
 
               update_license (view);
-              marker_reposition (view);
+              g_idle_add (marker_reposition, view);
               champlain_view_center_on (view, priv->latitude, priv->longitude);
             }
           }
@@ -1000,7 +1000,7 @@ champlain_view_center_on (ChamplainView *view,
   g_object_notify (G_OBJECT (view), "latitude");
 
   map_load_visible_tiles (priv->map, priv->viewport_size, priv->offline);
-  marker_reposition (view);
+  g_idle_add (marker_reposition, view);
 }
 
 /**
@@ -1081,10 +1081,10 @@ champlain_view_add_layer (ChamplainView *view, ClutterActor *layer)
   clutter_actor_raise_top (layer);
 
   if (priv->map)
-    marker_reposition (view);
+    g_idle_add (marker_reposition, view);
 
   g_signal_connect_after (layer,
-                    "add",
+                    "actor-added",
                     G_CALLBACK (layer_add_marker_cb),
                     view);