[pyatspi2] Expect that a children-changed signal may have detail additional to add/remove



commit 6b3fecc8c3b4c69926d2d3e1f87c4408c450ea7f
Author: Mike Gorse <mgorse novell com>
Date:   Thu Jun 3 11:43:08 2010 -0400

    Expect that a children-changed signal may have detail additional to add/remove
    
    When updating the cache, use startswith rather than == to heck the detail
    of children-changed signals, sine Firefox sometimes sends
    add:system/remove:system

 pyatspi/cache.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/pyatspi/cache.py b/pyatspi/cache.py
index 6d16d31..374c2cb 100644
--- a/pyatspi/cache.py
+++ b/pyatspi/cache.py
@@ -146,7 +146,6 @@ class DesktopCacheManager (object):
                 if interface==_ATSPI_EVENT_OBJECT_INTERFACE and sender == self._unique_name and path == ATSPI_ROOT_PATH:
                         if minor == "add":
                                 bus_name, object_path = any_data
-                                r = registry.Registry()
                                 self._application_list[bus_name] = ApplicationCacheManager(self._cache, bus_name)
                                 self._cache[(self._unique_name, ATSPI_ROOT_PATH)].children.append (any_data)
                         elif minor == "remove":
@@ -263,9 +262,9 @@ class ApplicationCacheManager (object):
                                 item = self._cache[(sender, path)]
                                 if item.state[0] & (1 << state.STATE_MANAGES_DESCENDANTS):
                                         return
-                                if minor == "add":
+                                if minor.startswith("add"):
                                         item.children.insert (detail1, any_data)
-                                elif minor == "remove":
+                                elif minor.startswith("remove"):
                                         item.children.remove (any_data)
                                         if any_data in self._cache:
                                                 child = self._cache[any_data]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]