[GTKUI] Fix showing cache status ratio

This commit is contained in:
Calum Lind 2017-01-26 10:03:17 +00:00
parent 4a344e382b
commit 6b49f844dc
1 changed files with 3 additions and 1 deletions

View File

@ -727,7 +727,9 @@ class Preferences(component.Component):
for widget_name in cache_labels:
widget = self.builder.get_object(widget_name)
key = 'disk.' + widget_name[len('label_cache_'):]
key = widget_name[len('label_cache_'):]
if not widget_name.endswith('ratio'):
key = 'disk.' + key
value = self.cache_status.get(key, 0)
if isinstance(value, float):
value = '%.2f' % value