[libgda/gtk3] Improved data model import's error messages



commit 83fa2fea502b19e8d63287f2eb9f500b07e6cfda
Author: Vivien Malerba <malerba gnome-db org>
Date:   Thu Oct 28 15:43:12 2010 +0200

    Improved data model import's error messages

 libgda/gda-data-model-import.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/libgda/gda-data-model-import.c b/libgda/gda-data-model-import.c
index 942624b..fdd6f42 100644
--- a/libgda/gda-data-model-import.c
+++ b/libgda/gda-data-model-import.c
@@ -1826,17 +1826,26 @@ add_error_too_few_values (GdaDataModelImport *model)
 
 	switch (model->priv->format){
 	case FORMAT_CSV:
-		str = g_strdup_printf (_("Row at line %d does not have enough values, "
-					 "completed with NULL values"),
-				       model->priv->extract.csv.text_line > 1 ?
-				       model->priv->extract.csv.text_line - 1 :
-				       model->priv->extract.csv.text_line);
+		if (model->priv->strict)
+			str = g_strdup_printf (_("Row at line %d does not have enough values"),
+					       model->priv->extract.csv.text_line > 1 ?
+					       model->priv->extract.csv.text_line - 1 :
+					       model->priv->extract.csv.text_line);
+		else
+			str = g_strdup_printf (_("Row at line %d does not have enough values, "
+						 "completed with NULL values"),
+					       model->priv->extract.csv.text_line > 1 ?
+					       model->priv->extract.csv.text_line - 1 :
+					       model->priv->extract.csv.text_line);
 		add_error (model, str);
 		g_free (str);
 		break;
 	default:
-		add_error (model, ("Row does not have enough values, "
-				    "completed with NULL values"));
+		if (model->priv->strict)
+			add_error (model, ("Row does not have enough values"));
+		else
+			add_error (model, ("Row does not have enough values, "
+					   "completed with NULL values"));
 		break;
 	}
 }



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