Browse Source

gui/audio: fixes from Marek's comments

Frédéric Pierret (fepitre) 4 years ago
parent
commit
7506482d08
2 changed files with 5 additions and 6 deletions
  1. 3 3
      qubes/ext/audio.py
  2. 2 3
      qubes/ext/gui.py

+ 3 - 3
qubes/ext/audio.py

@@ -45,8 +45,8 @@ class AUDIO(qubes.ext.Extension):
     def on_domain_init_load(self, vm, event):
         if getattr(vm, 'audiovm', None):
             if 'audiovm-' + vm.audiovm.name not in list(vm.tags):
-                vm.fire_event('property-set:audiovm',
-                              name='audiovm', newvalue=vm.audiovm)
+                self.on_property_set(vm, event, name='audiovm',
+                                     newvalue=vm.audiovm)
 
     # property-del <=> property-reset-to-default
     @qubes.ext.handler('property-del:audiovm')
@@ -60,7 +60,7 @@ class AUDIO(qubes.ext.Extension):
         # pulseaudio agent (module-vchan-sink) can connect to only one domain
         tags_list = list(subject.tags)
         for tag in tags_list:
-            if 'audiovm-' in tag:
+            if tag.startswith('audiovm-'):
                 subject.tags.remove(tag)
 
         if newvalue:

+ 2 - 3
qubes/ext/gui.py

@@ -55,8 +55,7 @@ class GUI(qubes.ext.Extension):
     def on_domain_init_load(self, vm, event):
         if getattr(vm, 'guivm', None):
             if 'guivm-' + vm.guivm.name not in list(vm.tags):
-                vm.fire_event('property-set:guivm',
-                              name='guivm', newvalue=vm.guivm)
+                self.on_property_set(vm, event, name='guivm', newvalue=vm.guivm)
 
     # property-del <=> property-reset-to-default
     @qubes.ext.handler('property-del:guivm')
@@ -70,7 +69,7 @@ class GUI(qubes.ext.Extension):
         # gui-daemon can connect to only one domain
         tags_list = list(subject.tags)
         for tag in tags_list:
-            if 'guivm-' in tag:
+            if tag.startswith('guivm-'):
                 subject.tags.remove(tag)
 
         if newvalue: