[libchamplain] Make the memory cache cooperate better with other caches
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Make the memory cache cooperate better with other caches
- Date: Sun, 15 Aug 2010 21:18:20 +0000 (UTC)
commit 0ccec92391b75c12f8c765f45a454c022c3e614f
Author: JiÅ?Ã Techet <techet gmail com>
Date: Sun Aug 15 22:31:01 2010 +0200
Make the memory cache cooperate better with other caches
Signed-off-by: JiÅ?Ã Techet <techet gmail com>
champlain/champlain-memory-cache.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/champlain/champlain-memory-cache.c b/champlain/champlain-memory-cache.c
index 7d03609..ffef78f 100644
--- a/champlain/champlain-memory-cache.c
+++ b/champlain/champlain-memory-cache.c
@@ -365,6 +365,8 @@ store_tile (ChamplainTileCache *tile_cache,
{
g_return_if_fail (CHAMPLAIN_IS_MEMORY_CACHE (tile_cache));
+ ChamplainMapSource *map_source = CHAMPLAIN_MAP_SOURCE (tile_cache);
+ ChamplainMapSource *next_source = champlain_map_source_get_next_source (map_source);
ChamplainMemoryCache *memory_cache = CHAMPLAIN_MEMORY_CACHE (tile_cache);
ChamplainMemoryCachePrivate *priv = memory_cache->priv;
GList *link;
@@ -391,6 +393,9 @@ store_tile (ChamplainTileCache *tile_cache,
g_queue_push_head (priv->queue, member);
}
+
+ if (CHAMPLAIN_IS_TILE_CACHE (next_source))
+ champlain_tile_cache_store_tile (CHAMPLAIN_TILE_CACHE (next_source), tile, contents, size);
}
@@ -398,6 +403,13 @@ static void
refresh_tile_time (ChamplainTileCache *tile_cache,
ChamplainTile *tile)
{
+ g_return_if_fail (CHAMPLAIN_IS_MEMORY_CACHE (tile_cache));
+
+ ChamplainMapSource *map_source = CHAMPLAIN_MAP_SOURCE (tile_cache);
+ ChamplainMapSource *next_source = champlain_map_source_get_next_source (map_source);
+
+ if (CHAMPLAIN_IS_TILE_CACHE (next_source))
+ champlain_tile_cache_refresh_tile_time (CHAMPLAIN_TILE_CACHE (next_source), tile);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]