summaryrefslogtreecommitdiff
path: root/atspi/atspi-accessible.c
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2013-05-22 15:38:15 -0500
committerMike Gorse <mgorse@suse.com>2013-05-22 15:38:15 -0500
commitb89a09fd8733292bc59134574281f80a309fbaac (patch)
tree025447e8a43fa92ba63abfc28f13ba18bc37e571 /atspi/atspi-accessible.c
parent5b9c1723c5661b9d573b56af3673b488bf2136d7 (diff)
downloadat-spi2-core-b89a09fd8733292bc59134574281f80a309fbaac.tar.gz
Reinstate atspi_role_get_name
Atspi_role_get_name is used (by Orca, for instance) and was inadvertently removed with the enum refactor.
Diffstat (limited to 'atspi/atspi-accessible.c')
-rw-r--r--atspi/atspi-accessible.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index 322ebac1..0fff4fb2 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -488,24 +488,14 @@ atspi_accessible_get_role (AtspiAccessible *obj, GError **error)
gchar *
atspi_accessible_get_role_name (AtspiAccessible *obj, GError **error)
{
- AtspiRole role = atspi_accessible_get_role (obj, error);
- char *retval = NULL;
- GTypeClass *type_class;
- GEnumValue *value;
- const gchar *name = NULL;
-
- type_class = g_type_class_ref (ATSPI_TYPE_ROLE);
- g_return_val_if_fail (G_IS_ENUM_CLASS (type_class), NULL);
-
- value = g_enum_get_value (G_ENUM_CLASS (type_class), role);
+ gchar *retval = NULL;
+ AtspiRole role;
- if (value)
- {
- retval = g_strdup (value->value_nick);
- }
+ g_return_val_if_fail (obj != NULL, NULL);
- if (retval)
- return _atspi_name_compat (g_strdup (retval));
+ role = atspi_accessible_get_role (obj, error);
+ if (role >= 0 && role < ATSPI_ROLE_COUNT && role != ATSPI_ROLE_EXTENDED)
+ return atspi_role_get_name (role);
_atspi_dbus_call (obj, atspi_interface_accessible, "GetRoleName", error, "=>s", &retval);