[libgda] Correction for bug #624088, and set correct error codes



commit 51dc11a425406190b3d62d240c30daef38eba305
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sun Jul 11 11:28:58 2010 +0200

    Correction for bug #624088, and set correct error codes

 libgda/gda-set.c |    2 +-
 libgda/gda-set.h |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libgda/gda-set.c b/libgda/gda-set.c
index 58254d4..430c4f3 100644
--- a/libgda/gda-set.c
+++ b/libgda/gda-set.c
@@ -981,7 +981,7 @@ validate_change_holder_cb (GdaHolder *holder, const GValue *value, GdaSet *set)
 	/* signal the holder validate-change */
 	GError *error = NULL;
 	if (set->priv->read_only)
-		g_set_error (&error, 0, 0, _("Data set does not allow mofifications"));
+		g_set_error (&error, GDA_SET_ERROR, GDA_SET_READ_ONLY_ERROR, _("Data set does not allow modifications"));
 	else {
 #ifdef GDA_DEBUG_signal
 		g_print (">> 'VALIDATE_HOLDER_CHANGE' from %s\n", __FUNCTION__);
diff --git a/libgda/gda-set.h b/libgda/gda-set.h
index 8dd10a0..ad96d33 100644
--- a/libgda/gda-set.h
+++ b/libgda/gda-set.h
@@ -41,7 +41,8 @@ typedef enum
 {
 	GDA_SET_XML_SPEC_ERROR,
 	GDA_SET_HOLDER_NOT_FOUND_ERROR,
-	GDA_SET_INVALID_ERROR
+	GDA_SET_INVALID_ERROR,
+	GDA_SET_READ_ONLY_ERROR
 } GdaSetError;
 
 struct _GdaSetNode {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]