[libchamplain] NetworkMapSource: Use champlain_cache_get_filename



commit 50f3d9ea3416d9a2e6c81e6cd0746b3073075c84
Author: Simon Wenner <simon wenner ch>
Date:   Sat Jul 25 23:13:49 2009 +0200

    NetworkMapSource: Use champlain_cache_get_filename

 champlain/champlain-network-map-source.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/champlain/champlain-network-map-source.c b/champlain/champlain-network-map-source.c
index 6055f16..c29d89c 100644
--- a/champlain/champlain-network-map-source.c
+++ b/champlain/champlain-network-map-source.c
@@ -373,18 +373,6 @@ champlain_network_map_source_set_uri_format (ChamplainNetworkMapSource *source,
   priv->uri_format = g_strdup (uri_format);
 }
 
-static gchar *
-get_filename (ChamplainNetworkMapSource *source,
-    ChamplainTile *tile)
-{
-  return g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S
-             "%s" G_DIR_SEPARATOR_S "%d" G_DIR_SEPARATOR_S
-             "%d" G_DIR_SEPARATOR_S "%d.png", g_get_user_cache_dir (),
-             CACHE_SUBDIR, champlain_map_source_get_id (CHAMPLAIN_MAP_SOURCE (source)),
-             champlain_tile_get_zoom_level (tile),
-             champlain_tile_get_x (tile), champlain_tile_get_y (tile));
-}
-
 static void
 file_loaded_cb (SoupSession *session,
     SoupMessage *msg,
@@ -552,7 +540,7 @@ fill_tile (ChamplainMapSource *map_source,
   ChamplainCache *cache = champlain_cache_dup_default ();
 
   /* Try the cached version first */
-  filename = get_filename (source, tile);
+  filename = champlain_cache_get_filename (cache, map_source, tile, NULL);
   champlain_tile_set_filename (tile, filename);
   champlain_tile_set_size (tile, champlain_map_source_get_tile_size (map_source));
 



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