From 92c3ba578a3b2f0a83a39a633b4e92d13255319f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 15 Aug 2016 23:53:11 +0200 Subject: [PATCH] appmenus: register event handlers on QubesVM, not BaseVM It is critical to call rename-related events in the right order related to those in QubesVM, because handler at QubesVM renames VM directory. After "qubes/events: fix event handlers ordering" in qubes-core-admin it is (again) possible to deterministically order event handler from extension in relation to those from the class itself. But since ordering on object class have higher priority (first from base class), those handlers needs to be attached to the same class. --- qubesappmenus/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qubesappmenus/__init__.py b/qubesappmenus/__init__.py index 1dc694b..be5ca46 100644 --- a/qubesappmenus/__init__.py +++ b/qubesappmenus/__init__.py @@ -300,13 +300,13 @@ class AppmenusExtension(qubes.ext.Extension): return shutil.rmtree(self.icons_dir(vm)) - @qubes.ext.handler('property-pre-set:name') + @qubes.ext.handler('property-pre-set:name', vm=qubes.vm.qubesvm.QubesVM) def pre_rename(self, vm, event, prop, *args): if not os.path.exists(vm.dir_path): return self.appmenus_remove(vm) - @qubes.ext.handler('property-set:name') + @qubes.ext.handler('property-set:name', vm=qubes.vm.qubesvm.QubesVM) def post_rename(self, vm, event, prop, *args): if not os.path.exists(vm.dir_path): return