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 c9323a80133a35bce194e69781c0934e2903b2ec..e86b73bd049227132974bc48433613331760ad86 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 15a3353c741a7c9b9daf9f6b37b58975c983e94d..fd35b857e3ee36d6ddca94c64a87cf740697b4fa 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
 
 #------------------------------------------------------------------------------