Skip to content

Commit

Permalink
Device change event: properties are not updated. Fixes #9 (thanks @sh…
Browse files Browse the repository at this point in the history
  • Loading branch information
J. Félix Ontañón committed Aug 9, 2014
1 parent 320cd33 commit 44d2605
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions udev-discover.in
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ class UDevDiscoverGUI(GConfStore):

self.logger.info(_('Device removed: %s') % device.nice_label)

def changed_device(self, device_finder, device):
old_device = self.device_finder.get_devices_tree()[device.path]
def changed_device(self, device_finder, device, old_device):

if self.rows.has_key(device.path):
# Remove from tree first
Expand Down
8 changes: 5 additions & 3 deletions udevdiscover/devicefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class DeviceFinder(GObject.GObject):
(GObject.TYPE_PYOBJECT,)),
'removed': (GObject.SignalFlags.RUN_LAST, None,
(GObject.TYPE_PYOBJECT,)),
'changed': (GObject.SignalFlags.RUN_LAST, None,
(GObject.TYPE_PYOBJECT,)),
'changed': (GObject.SignalFlags.RUN_LAST, None,
(GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT,)),
}

def __init__(self, subsystems='', parent_tree=False):
Expand Down Expand Up @@ -143,7 +143,9 @@ def device_changed(self, gudevice, subsystem):
'''Called when a device has been updated'''

dev = device.get_device_object(gudevice)
self.emit('changed', dev)
old_dev = self.devices_tree[dev.path]
self.devices_tree[dev.path] = dev
self.emit('changed', dev, old_dev)

GObject.type_register(DeviceFinder)

Expand Down

0 comments on commit 44d2605

Please sign in to comment.