diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-01-11 18:02:25 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-01-11 18:04:08 (GMT) |
commit | 8e1c13f3e7de10aefb45320d85c360fdefb2b692 (patch) | |
tree | b2b33d788902788c57cffd8957e6cfa93019216c | |
parent | e99b69396b1c77ec4cb454b71362cd41fdf45111 (diff) |
#5863 Correctly invalidate icon cache.
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | misc.py | 7 |
2 files changed, 5 insertions, 3 deletions
@@ -1,3 +1,4 @@ +* #5863 Correctly invalidate icon cache. (tomeu) * #3092 Change the color of the preview box. (rwh) 82 @@ -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 |