2008-12-04 Mark Doffman <mark.doffman@codethink.co.uk>
authorMark Doffman <mdoff@silver-wind.(none)>
Thu, 4 Dec 2008 20:16:13 +0000 (20:16 +0000)
committerMark Doffman <mdoff@silver-wind.(none)>
Thu, 4 Dec 2008 20:16:13 +0000 (20:16 +0000)
        * pyatspi/accessible.py
        * pyatspi/accessiblecache.py
          Modify the cache adding a stateset.
          Modify the getState function to use the
          cached values.

pyatspi/accessible.py
pyatspi/accessiblecache.py

index c9323a8..e86b73b 100644 (file)
@@ -207,9 +207,7 @@ class Accessible(BaseProxy):
         @return : a StateSet encapsulating the currently true states
         of the object.
         """
-        func = self.get_dbus_method("getState", dbus_interface=ATSPI_ACCESSIBLE)
-        bitfield = func()
-        return _marshal_state_set(bitfield)
+        return _marshal_state_set(self.cached_data.state)
 
     def isEqual(self, accessible):
         """
index 15a3353..fd35b85 100644 (file)
@@ -26,6 +26,7 @@ class _CacheData(object):
                         'role',
                         'name',
                         'description',
+                        'state',
                     ]
 
         def __init__(self, data):
@@ -39,7 +40,8 @@ class _CacheData(object):
                 self.interfaces,
                 self.name,
                 self.role,
-                self.description) = data
+                self.description,
+                self.state) = data
 
 #------------------------------------------------------------------------------