From aea6b3c1f512e8ec7affee1e48b405116ff73eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 14 Apr 2014 04:12:00 +0200 Subject: [PATCH] appmenus: fix creating appmenus when no entry is selected --- appmenus-scripts/qubes-core-appmenus.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/appmenus-scripts/qubes-core-appmenus.py b/appmenus-scripts/qubes-core-appmenus.py index 5bad133..4e49f1c 100644 --- a/appmenus-scripts/qubes-core-appmenus.py +++ b/appmenus-scripts/qubes-core-appmenus.py @@ -105,7 +105,10 @@ def QubesVm_appicons_create(self, srcdir=None): return whitelist = os.path.join(self.dir_path, vm_files['appmenus_whitelist']) - whitelist = [line.strip() for line in open(whitelist)] + if os.path.exists(whitelist): + whitelist = [line.strip() for line in open(whitelist)] + else: + whitelist = None if not os.path.exists(self.appmenus_icons_dir): os.mkdir(self.appmenus_icons_dir) @@ -115,7 +118,7 @@ def QubesVm_appicons_create(self, srcdir=None): for icon in os.listdir(srcdir): desktop = os.path.splitext(icon)[0] + '.desktop' - if desktop not in whitelist: + if whitelist and desktop not in whitelist: continue qubes.imgconverter.tint(os.path.join(srcdir, icon),