Fix some symbol bugs in atk-adaptors.
authorMark Doffman <mdoff@silver-wind.(none)>
Wed, 14 Jan 2009 16:08:22 +0000 (16:08 +0000)
committerMark Doffman <mdoff@silver-wind.(none)>
Wed, 14 Jan 2009 16:08:22 +0000 (16:08 +0000)
Switch to single accessible update in pyatspi.

atk-adaptor/accessible-register.c
pyatspi/accessiblecache.py

index 60a721e..d1418f8 100644 (file)
@@ -165,7 +165,7 @@ traverse_atk_tree (AtkObject *accessible,
   guint      i;
   gboolean   recurse;
 
-  if (!filter (accessible))
+  if (filter (accessible))
       return;
 
   stack = g_queue_new ();
@@ -187,7 +187,7 @@ traverse_atk_tree (AtkObject *accessible,
         {
           tmp = atk_object_ref_accessible_child (current, i);
           /* If filter function */
-          if (filter (tmp))
+          if (!filter (tmp))
             {
               recurse = TRUE;
             }
@@ -267,7 +267,7 @@ register_subtree (AtkObject *accessible)
 
   traverse_atk_tree (accessible,
                      &registered,
-                     (ActionFunc) register_accessible,
+                     (ActionFunc) register_action,
                      (FilterFunc) register_filter);
 
   g_list_foreach (registered, register_foreach, NULL);
@@ -344,7 +344,7 @@ atk_dbus_object_to_path (AtkObject *accessible)
   if (!ref)
       return NULL;
   else
-      return atk_dbus_ref_to_path (ref);
+      return ref_to_path (ref);
 }
 
 /*---------------------------------------------------------------------------*/
index 213d4af..17f3bb7 100644 (file)
@@ -97,7 +97,7 @@ class AccessibleCache(object):
                 get_method = itf.get_dbus_method(self._GET_METHOD)
                 self._update_objects(get_method())
 
-                self._updateMatch = itf.connect_to_signal(self._UPDATE_SIGNAL, self._update_objects)
+                self._updateMatch = itf.connect_to_signal(self._UPDATE_SIGNAL, self._update_single)
                 self._removeMatch = itf.connect_to_signal(self._REMOVE_SIGNAL, self._remove_object)
 
                 obj = connection.get_object(self._bus_name, self._PATH, introspect=False)
@@ -159,6 +159,10 @@ class AccessibleCache(object):
                                        ("remove", 0, 0, ""))
                         self._registry._notifyChildrenChange(event)
 
+        # TODO This should be the other way around. Single is more common than many.
+        def _update_single(self, object):
+                self._update_objects ([object])
+
         def _update_objects(self, objects):
                 cache_update_objects = []
                 for data in objects: