Fix return value of spi_check_ev and have it call spi_throw_exception if an exception...
authorMike Gorse <mgorse@boston.site>
Thu, 26 Jun 2008 18:41:38 +0000 (14:41 -0400)
committerMike Gorse <mgorse@boston.site>
Thu, 26 Jun 2008 18:41:38 +0000 (14:41 -0400)
Hav spi_throw_exception take a const char * for an error prefix

cspi/spi-private.h
cspi/spi_main.c

index 3e8926c..43f61d2 100644 (file)
@@ -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);
                                               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);
 
 AccessibleAttributeSet 
                      *_cspi_attribute_set_from_sequence (const GArray *seq);
index 36d18a0..d544bb7 100644 (file)
@@ -47,7 +47,7 @@ cspi_object_release (gpointer value)
 }
 
 gboolean
 }
 
 gboolean
-cspi_exception_throw (DBusError *error, char *desc_prefix)
+cspi_exception_throw (DBusError *error, const char *desc_prefix)
 {
   SPIExceptionHandler *handler = NULL;
   SPIException ex;
 {
   SPIExceptionHandler *handler = NULL;
   SPIException ex;
@@ -163,10 +163,15 @@ cspi_exception (void)
   return FALSE;
 }
 
   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 *
 }
 
 Accessible *