Commits

Alex Grönholm committed a630491

MirrorObject: avoid firing events for properties for which there are no registered listeners

Comments (0)

Files changed (2)

 * CHANGED: @inlineCallbacks now uses @swingRun instead of @swingCall to avoid
   certain undesirable side effects (the calling thread would get stuck waiting
   for the generator to exit)
+* CHANGED: MirrorObject only fires events for properties for which there are
+  registered listeners (if no global event listeners are registered)
 
 
 v1.0b2

swingutils/beans.py

 
         # Collect public property names from both old and new
         propertyNames = set()
-        for attr in (dir(oldDelegate) + dir(newDelegate)):
-            if not attr.startswith('_'):
+        for attr in set(dir(oldDelegate) + dir(newDelegate)):
+            if not attr.startswith('_') and self.hasListeners(attr):
                 propertyNames.add(attr)
 
         # Fire a property change event for each attribute