Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2012-04-16 21:24:20 (GMT)
committer Daniel Drake <dsd@laptop.org>2012-04-16 21:24:20 (GMT)
commit080c3eaf5f7011f975d5670e937deadaa2f84367 (patch)
tree284aceaad241cf22de04ae4dba94e1f08e23c369 /extensions
parentd12a40da7c3ae575d8afbc78ab591f75f9392e0b (diff)
Prevent handling network devices twice (OLPC#11782)
Due to the asynchronous way that dbus works, it is possible to receive a network device listed in the initial GetDevices call, and as a DeviceAdded signal, if the device appears during Sugar initialisation. Check to see that a device is really new before processing it. Fixes a case seen by Manuel and me where two network device icons appear. Signed-off-by: Daniel Drake <dsd@laptop.org>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/deviceicon/network.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/extensions/deviceicon/network.py b/extensions/deviceicon/network.py
index 09a3abb..96713fb 100644
--- a/extensions/deviceicon/network.py
+++ b/extensions/deviceicon/network.py
@@ -1020,6 +1020,9 @@ class NetworkManagerObserver(object):
logging.error('Failed to get devices: %s', err)
def _check_device(self, device_op):
+ if device_op in self._devices:
+ return
+
nm_device = self._bus.get_object(network.NM_SERVICE, device_op)
props = dbus.Interface(nm_device, dbus.PROPERTIES_IFACE)