From f70112b3ebb4b50efed40c97eab02554652866b8 Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Thu, 26 Jun 2008 14:41:38 -0400 Subject: [PATCH] Fix return value of spi_check_ev and have it call spi_throw_exception if an exception is received Hav spi_throw_exception take a const char * for an error prefix --- cspi/spi-private.h | 2 +- cspi/spi_main.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cspi/spi-private.h b/cspi/spi-private.h index 3e8926c..43f61d2 100644 --- a/cspi/spi-private.h +++ b/cspi/spi-private.h @@ -92,7 +92,7 @@ SPIBoolean cspi_accessible_is_a (Accessible *accessible, const char *interface_name); AccessibleRole cspi_role_from_spi_role (Accessibility_Role role); void cspi_streams_close_all (void); -gboolean cspi_exception_throw (DBusError *error, char *desc_prefix); +gboolean cspi_exception_throw (DBusError *error, const char *desc_prefix); AccessibleAttributeSet *_cspi_attribute_set_from_sequence (const GArray *seq); diff --git a/cspi/spi_main.c b/cspi/spi_main.c index 36d18a0..d544bb7 100644 --- a/cspi/spi_main.c +++ b/cspi/spi_main.c @@ -47,7 +47,7 @@ cspi_object_release (gpointer value) } gboolean -cspi_exception_throw (DBusError *error, char *desc_prefix) +cspi_exception_throw (DBusError *error, const char *desc_prefix) { SPIExceptionHandler *handler = NULL; SPIException ex; @@ -163,10 +163,15 @@ cspi_exception (void) return FALSE; } -SPIBoolean cspi_check_ev (const char *error_string) +SPIBoolean +cspi_check_ev (const char *error_string) { - // TODO: Store exception - return FALSE; + if (dbus_error_is_set (&exception)) + { + cspi_exception_throw (&exception, error_string); + return FALSE; + } + return TRUE; } Accessible * -- 2.7.4