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.
This commit is contained in:
parent
da9205c78a
commit
92c3ba578a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user