[at-spi2-core] Change some error return values to match AT-SPI-CORBA behavior
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Change some error return values to match AT-SPI-CORBA behavior
- Date: Sat, 4 Dec 2010 10:13:45 +0000 (UTC)
commit 3221e4d296e89888bade934a545d05b353b88526
Author: Mike Gorse <mgorse novell com>
Date: Fri Dec 3 13:08:13 2010 -0500
Change some error return values to match AT-SPI-CORBA behavior
atspi/atspi-accessible.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index 13b0d73..9e5c503 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -242,12 +242,12 @@ atspi_role_get_name (AtspiRole role)
gchar *
atspi_accessible_get_name (AtspiAccessible *obj, GError **error)
{
- g_return_val_if_fail (obj != NULL, NULL);
+ g_return_val_if_fail (obj != NULL, g_strdup (""));
if (!(obj->cached_properties & ATSPI_CACHE_NAME))
{
if (!_atspi_dbus_get_property (obj, atspi_interface_accessible, "Name", error,
"s", &obj->name))
- return NULL;
+ return g_strdup ("");
obj->cached_properties |= ATSPI_CACHE_NAME;
}
return g_strdup (obj->name);
@@ -265,12 +265,12 @@ atspi_accessible_get_name (AtspiAccessible *obj, GError **error)
gchar *
atspi_accessible_get_description (AtspiAccessible *obj, GError **error)
{
- g_return_val_if_fail (obj != NULL, NULL);
+ g_return_val_if_fail (obj != NULL, g_strdup (""));
if (!(obj->cached_properties & ATSPI_CACHE_DESCRIPTION))
{
if (!_atspi_dbus_call (obj, atspi_interface_accessible, "GetDescription", NULL, "=>s", &obj->description))
- return NULL;
+ return g_strdup ("");
obj->cached_properties |= ATSPI_CACHE_DESCRIPTION;
}
return g_strdup (obj->description);
@@ -506,10 +506,13 @@ atspi_accessible_get_role_name (AtspiAccessible *obj, GError **error)
{
char *retval = NULL;
- g_return_val_if_fail (obj != NULL, g_strdup ("invalid"));
+ g_return_val_if_fail (obj != NULL, NULL);
_atspi_dbus_call (obj, atspi_interface_accessible, "GetRoleName", error, "=>s", &retval);
+ if (!retval)
+ retval = g_strdup ("");
+
return retval;
}
@@ -529,10 +532,13 @@ atspi_accessible_get_localized_role_name (AtspiAccessible *obj, GError **error)
{
char *retval = NULL;
- g_return_val_if_fail (obj != NULL, g_strdup ("invalid"));
+ g_return_val_if_fail (obj != NULL, NULL);
_atspi_dbus_call (obj, atspi_interface_accessible, "GetLocalizedRoleName", error, "=>s", &retval);
+ if (!retval)
+ return g_strdup ("");
+
return retval;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]