[libchamplain] Fix TODO in view_reload_tiles_cb()



commit a5b2886908dc4e69fb949d410abbf4fc23d5cfe1
Author: JiÅ?í Techet <techet gmail com>
Date:   Sun Mar 14 00:36:37 2010 +0100

    Fix TODO in view_reload_tiles_cb()
    
    For tile reloading we can first destroy all tiles and then load them in
    a standard way.
    
    Signed-off-by: JiÅ?í Techet <techet gmail com>

 champlain/champlain-view.c |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 7fe6cbf..6d557c8 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -2370,27 +2370,15 @@ view_reload_tiles_cb (ChamplainMapSource *map_source,
     ChamplainView* view)
 {
   ChamplainViewPrivate *priv = GET_PRIVATE (view);
-  gint i, tile_count;
 
-  // update current_level
-  tile_count = clutter_group_get_n_children (CLUTTER_GROUP (priv->map_zoom_level));
-
-  for (i = 0; i < tile_count; i++)
+  while (clutter_group_get_n_children (CLUTTER_GROUP (priv->map_zoom_level)) > 0)
     {
-      ChamplainTile *tile = CHAMPLAIN_TILE (clutter_group_get_nth_child (CLUTTER_GROUP (priv->map_zoom_level), i));
+      ChamplainTile *tile = CHAMPLAIN_TILE (clutter_group_get_nth_child (CLUTTER_GROUP (priv->map_zoom_level), 0));
 
-      DEBUG("Reload tile: %d, %d\n", champlain_tile_get_x (tile),
-          champlain_tile_get_y (tile));
-
-      // TODO - we should destroy the loading tiles (they may be loading
-      // with different parameters of the renderer) and load new tiles instead
-      if (champlain_tile_get_state (tile) != CHAMPLAIN_STATE_LOADING)
-        {
-          champlain_tile_set_state (tile, CHAMPLAIN_STATE_LOADING);
-          champlain_map_source_fill_tile (priv->map_source, tile);
-        }
+      clutter_container_remove_actor (CLUTTER_CONTAINER (priv->map_zoom_level), CLUTTER_ACTOR (tile));
     }
-  view_update_state (view);
+
+  view_load_visible_tiles (view);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]