/*---------------------------------------------------------------------------*/
-static void
+static gboolean
register_application (SpiBridge * app)
{
DBusMessage *message, *reply;
dbus_message_iter_init (reply, &iter);
dbus_message_iter_recurse (&iter, &iter_struct);
if (!(dbus_message_iter_get_arg_type (&iter_struct) == DBUS_TYPE_STRING))
- g_error ("AT-SPI: Could not obtain desktop path or name\n");
+ {
+ g_warning ("AT-SPI: Could not obtain desktop path or name\n");
+ return FALSE;
+ }
dbus_message_iter_get_basic (&iter_struct, &app_name);
if (!dbus_message_iter_next (&iter_struct))
- g_error ("AT-SPI: Could not obtain desktop name");
+ {
+ g_warning ("AT-SPI: Could not obtain desktop name");
+ return FALSE;
+ }
if (!(dbus_message_iter_get_arg_type (&iter_struct) == DBUS_TYPE_OBJECT_PATH))
- g_error ("AT-SPI: Could not obtain desktop path");
+ {
+ g_warning ("AT-SPI: Could not obtain desktop path");
+ return FALSE;
+ }
dbus_message_iter_get_basic (&iter_struct, &obj_path);
app->desktop_name = g_strdup (app_name);
}
else
{
- g_error ("AT-SPI: Could not embed inside desktop: %s\n", error.message);
+ g_warning ("AT-SPI: Could not embed inside desktop: %s\n", error.message);
+ return FALSE;
}
-
+ return TRUE;
}
/*---------------------------------------------------------------------------*/
treepath = droute_add_one (spi_global_app_data->droute,
"/org/at_spi/cache", spi_global_cache);
+ if (!treepath)
+ {
+ g_warning ("atk-bridge: Error in droute_add_one(). Already running?");
+ return 0;
+ }
+
accpath = droute_add_many (spi_global_app_data->droute,
"/org/a11y/atspi/accessible",
NULL,
registered = dbus_connection_register_object_path (cnx->bus, path, &droute_vtable, new_path);
if (!registered)
- oom();
+ {
+ path_free (new_path, NULL);
+ return NULL;
+ }
g_ptr_array_add (cnx->registered_paths, new_path);
return new_path;