Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2008-01-11 18:02:25 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2008-01-11 18:04:08 (GMT)
commit8e1c13f3e7de10aefb45320d85c360fdefb2b692 (patch)
treeb2b33d788902788c57cffd8957e6cfa93019216c
parente99b69396b1c77ec4cb454b71362cd41fdf45111 (diff)
#5863 Correctly invalidate icon cache.
-rw-r--r--NEWS1
-rw-r--r--misc.py7
2 files changed, 5 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index d006d66..58689b6 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+* #5863 Correctly invalidate icon cache. (tomeu)
* #3092 Change the color of the preview box. (rwh)
82
diff --git a/misc.py b/misc.py
index b1b8144..3bfebc6 100644
--- a/misc.py
+++ b/misc.py
@@ -48,8 +48,9 @@ _icon_cache = LRU(50)
def get_icon_name(jobject):
- if jobject.object_id in _icon_cache:
- return _icon_cache[jobject.object_id]
+ cache_key = (jobject.object_id, jobject.metadata.get('timestamp', None))
+ if cache_key in _icon_cache:
+ return _icon_cache[cache_key]
file_name = None
@@ -77,7 +78,7 @@ def get_icon_name(jobject):
if not file_name:
return _get_icon_file_name('application-octet-stream')
- _icon_cache[jobject.object_id] = file_name
+ _icon_cache[cache_key] = file_name
return file_name