From: Mariusz Wachowicz Date: Thu, 10 Aug 2017 09:29:48 +0000 (+0200) Subject: move ref_accessible function to public scope X-Git-Tag: accepted/tizen/4.0/unified/20170828.222518~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fat-spi2-core.git;a=commitdiff_plain;h=87ea2e308098bb8fb316fc5fc7fd39141dfbc51d move ref_accessible function to public scope this function is needed outside at-spi library (other projects, e.g. universal-switch), to get AtspiAccessible object after it has been received as application name and path name Change-Id: I51e72af3f191d4a14174cd0b4819522154e3e1ba --- diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 193257b..02eab8c 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -260,7 +260,7 @@ get_application (const char *bus_name) return app; } -static AtspiAccessible * +AtspiAccessible * ref_accessible (const char *app_name, const char *path) { AtspiApplication *app; @@ -1149,11 +1149,12 @@ out: process_deferred_messages (); if (dbus_error_is_set (&err)) { - /* TODO: Set gerror */ + g_set_error_literal(error, ATSPI_ERROR, ATSPI_ERROR_IPC, err.message); dbus_error_free (&err); + if (reply) + dbus_message_unref(reply); } - - if (reply && dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR) + else if (reply && dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) { const char *err_str = NULL; dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &err_str, DBUS_TYPE_INVALID); @@ -1162,7 +1163,6 @@ out: dbus_message_unref (reply); return NULL; } - return reply; } diff --git a/atspi/atspi-misc.h b/atspi/atspi-misc.h index f13596f..e39d7b8 100644 --- a/atspi/atspi-misc.h +++ b/atspi/atspi-misc.h @@ -47,6 +47,9 @@ void atspi_set_main_context (GMainContext *cnx); gchar * atspi_role_get_name (AtspiRole role); + +AtspiAccessible *ref_accessible(const char *app_name, const char *path); + G_END_DECLS #endif /* _ATSPI_MISC_H_ */