2009-27-09 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / pyatspi / applicationcache.py
index 96a9830..68fa65a 100644 (file)
@@ -233,4 +233,16 @@ class ApplicationCache(object):
                 """
                 return self._connection
 
+        def _refresh(self):
+                new = self._app_register.getApplications()
+                removed = [item for item in self.application_list if item not in new]
+                added   = [item for item in new if item not in self.application_list]
+                for item in added:
+                        self.update_handler (self._APPLICATIONS_ADD, item)
+                for item in removed:
+                        self.update_handler (self._APPLICATIONS_REMOVE, item)
+
+                for item in self.application_cache.values():
+                        item._refresh()
+
 #END----------------------------------------------------------------------------