base: drop the separate function for bluez updates

A lambda does the job here without increasing the class profile
This commit is contained in:
Peter Hutterer 2019-07-17 10:13:14 +10:00
parent 08e3ec532e
commit 92a9628adf
1 changed files with 4 additions and 5 deletions

View File

@ -309,8 +309,10 @@ class Tuhi(GObject.Object):
for dev in self.bluez.devices:
self._add_device(self.bluez, dev)
self.bluez.connect('device-added', self._on_bluez_device_updated)
self.bluez.connect('device-updated', self._on_bluez_device_updated)
self.bluez.connect('device-added',
lambda mgr, dev: self._add_device(mgr, dev, True))
self.bluez.connect('device-updated',
lambda mgr, dev: self._add_device(mgr, dev, True))
def _on_tuhi_bus_name_lost(self, dbus_server):
self.mainloop.quit()
@ -401,9 +403,6 @@ class Tuhi(GObject.Object):
elif d.listening:
d.listen()
def _on_bluez_device_updated(self, manager, bluez_device):
self._add_device(manager, bluez_device, True)
def _on_listening_updated(self, tuhi_dbus_device, pspec):
listen = self._search_stop_handler is not None
for dev in self.devices.values():