[libgda] Misc. corrections



commit 486da1f1b07af3749fef7d7b8f6df2623a244898
Author: Vivien Malerba <malerba gnome-db org>
Date:   Wed Mar 16 17:45:36 2011 +0100

    Misc. corrections

 libgda-ui/data-entries/plugins/libmain.c |   40 +++++++++++++++--------------
 libgda/gda-config.c                      |    4 +-
 libgda/gda-data-model.c                  |    5 +++-
 3 files changed, 27 insertions(+), 22 deletions(-)
---
diff --git a/libgda-ui/data-entries/plugins/libmain.c b/libgda-ui/data-entries/plugins/libmain.c
index ea3b7af..734cb6d 100644
--- a/libgda-ui/data-entries/plugins/libmain.c
+++ b/libgda-ui/data-entries/plugins/libmain.c
@@ -1,5 +1,5 @@
-/* libmain.c
- * Copyright (C) 2006 - 2010 The GNOME Foundation
+/*
+ * Copyright (C) 2006 - 2011 The GNOME Foundation
  *
  * AUTHORS:
  *         Vivien Malerba <malerba gdaui org>
@@ -181,26 +181,28 @@ plugin_init (GError **error)
 			}
 			GtkSourceLanguageManager *lm;
 			const gchar * const * langs;
-			gint i;
 			lm = gtk_source_language_manager_get_default ();
 			langs = gtk_source_language_manager_get_language_ids (lm);
-			for (i = 0; ; i++) {
-				const gchar *tmp;
-				tmp = langs [i];
-				if (!tmp)
-					break;
-				if (node) {
-					xmlNodePtr row;
-					row = xmlNewChild (node, NULL, BAD_CAST "gda_array_row", NULL);
-					xmlNewChild (row, NULL, BAD_CAST "gda_value", BAD_CAST tmp);
-
-					GtkSourceLanguage *sl;
-					sl = gtk_source_language_manager_get_language (lm, tmp);
-					if (sl)
-						xmlNewChild (row, NULL, BAD_CAST "gda_value",
-							     BAD_CAST gtk_source_language_get_name (sl));
-					else
+			if (langs) {
+				gint i;
+				for (i = 0; ; i++) {
+					const gchar *tmp;
+					tmp = langs [i];
+					if (!tmp)
+						break;
+					if (node) {
+						xmlNodePtr row;
+						row = xmlNewChild (node, NULL, BAD_CAST "gda_array_row", NULL);
 						xmlNewChild (row, NULL, BAD_CAST "gda_value", BAD_CAST tmp);
+						
+						GtkSourceLanguage *sl;
+						sl = gtk_source_language_manager_get_language (lm, tmp);
+						if (sl)
+							xmlNewChild (row, NULL, BAD_CAST "gda_value",
+								     BAD_CAST gtk_source_language_get_name (sl));
+						else
+							xmlNewChild (row, NULL, BAD_CAST "gda_value", BAD_CAST tmp);
+					}
 				}
 			}
 
diff --git a/libgda/gda-config.c b/libgda/gda-config.c
index e758d89..406432e 100644
--- a/libgda/gda-config.c
+++ b/libgda/gda-config.c
@@ -391,8 +391,8 @@ load_config_file (const gchar *file, gboolean is_system)
 						info->auth_string = g_strdup (auth);
 					}
 					else if (res != GNOME_KEYRING_RESULT_NO_MATCH)
-						g_warning (_("Error loading authentification information for '%s' DSN: %s"),
-							   info->name, gnome_keyring_result_to_message (res));
+						gda_log_message (_("Error loading authentification information for '%s' DSN: %s"),
+								 info->name, gnome_keyring_result_to_message (res));
 					if (auth)
 						gnome_keyring_free_password (auth);
 				}
diff --git a/libgda/gda-data-model.c b/libgda/gda-data-model.c
index ce01fa0..976013b 100644
--- a/libgda/gda-data-model.c
+++ b/libgda/gda-data-model.c
@@ -2474,7 +2474,10 @@ real_gda_data_model_dump_as_string (GdaDataModel *model, gboolean dump_attribute
 			g_strfreev (cols_str [i]);
 		g_free (cols_str);
 	}
-	g_string_append_printf (string, ngettext("(%d row)\n", "(%d rows)\n", n_rows), n_rows);
+	if (n_rows > 0)
+		g_string_append_printf (string, ngettext("(%d row)\n", "(%d rows)\n", n_rows), n_rows);
+	else
+		g_string_append_printf (string, _("(0 row)\n"));
 
  out:
 	if (ramodel)



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