#5863 NORM Never A: downloaded bundles appear in the journal with unknown icon until reboot
Zarro Boogs per Child
bugtracker at laptop.org
Sat Jan 5 13:51:40 EST 2008
#5863: downloaded bundles appear in the journal with unknown icon until reboot
-------------------------------+--------------------------------------------
Reporter: tomeu | Owner: tomeu
Type: defect | Status: new
Priority: normal | Milestone: Never Assigned
Component: journal-activity | Version:
Resolution: | Keywords: Update.1? review?
Verified: 0 | Blocking:
Blockedby: |
-------------------------------+--------------------------------------------
Comment(by tomeu):
A safer patch:
{{{
diff --git a/misc.py b/misc.py
index b1b8144..4a3d5af 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
}}}
--
Ticket URL: <http://dev.laptop.org/ticket/5863#comment:1>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system
More information about the Bugs
mailing list