appmenus: force changing appicons when VM label is changed

Fixes QubesOS/qubes-issues#1606

(cherry picked from commit 4694f5f52f)
pull/18/head
Marek Marczykowski-Górecki 8 years ago
parent 5b1008540a
commit fd529f2c7d
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

@ -169,7 +169,7 @@ def QubesVm_appmenus_replace_entry(self, old_name, new_name):
f.write(''.join(new_lines))
def QubesVm_appicons_create(self, srcdir=None):
def QubesVm_appicons_create(self, srcdir=None, force=False):
if srcdir is None:
srcdir = self.appmenus_template_icons_dir
if srcdir is None:
@ -201,7 +201,7 @@ def QubesVm_appicons_create(self, srcdir=None):
src_icon = os.path.join(srcdir, icon)
dst_icon = os.path.join(self.appmenus_icons_dir, icon)
if not os.path.exists(dst_icon) or \
if not os.path.exists(dst_icon) or force or \
os.path.getmtime(src_icon) > os.path.getmtime(dst_icon):
qubes.imgconverter.tint(src_icon, dst_icon, self.label.color)
@ -315,7 +315,7 @@ def QubesVm_remove_from_disk(self):
def QubesVm_label_setter(self, _):
self.appicons_create()
self.appicons_create(force=True)
# Apparently desktop environments heavily caches the icons,
# see #751 for details

Loading…
Cancel
Save