Add Locale property, mapped to atk_object_get_object_locale
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / adaptors / application-adaptor.c
index 897ed55..260a4d7 100644 (file)
@@ -25,7 +25,7 @@
 #include <atk/atk.h>
 #include <droute/droute.h>
 
-#include "common/spi-dbus.h"
+#include "spi-dbus.h"
 #include "introspection.h"
 
 /* for spi_global_app_data  is there a better way? */
@@ -101,12 +101,20 @@ impl_get_app_bus(DBusConnection *bus, DBusMessage *msg, void *data)
 {
 DBusMessage *reply;
 
+  if (bus == spi_global_app_data->bus)
+    spi_atk_add_client (dbus_message_get_sender (msg));
+
+  if (!spi_global_app_data->app_bus_addr)
+    spi_atk_create_socket (spi_global_app_data);
+
 reply = dbus_message_new_method_return(msg);
 if (reply)
     {
       const char *retval = (g_getenv ("AT_SPI_CLIENT") ?
                             "":
                             spi_global_app_data->app_bus_addr);
+      if (!retval)
+        retval = "";
       dbus_message_append_args(reply, DBUS_TYPE_STRING, &retval, DBUS_TYPE_INVALID);
     }
 
@@ -142,7 +150,7 @@ void
 spi_initialize_application (DRoutePath * path)
 {
   droute_path_add_interface (path,
-                             SPI_DBUS_INTERFACE_APPLICATION,
+                             ATSPI_DBUS_INTERFACE_APPLICATION,
                              spi_org_a11y_atspi_Application,
                              methods, properties);
 };