[libgda/LIBGDA_4.2] Misc. corrections
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/LIBGDA_4.2] Misc. corrections
- Date: Wed, 23 Mar 2011 16:51:55 +0000 (UTC)
commit 0c08951132de2475fb9ae85a63df2cacba4943ca
Author: Vivien Malerba <malerba gnome-db org>
Date: Wed Mar 23 16:05:50 2011 +0100
Misc. corrections
libgda-ui/data-entries/plugins/libmain.c | 40 +++++++++++++++--------------
libgda/gda-config.c | 4 +-
libgda/gda-data-model.c | 6 ++--
3 files changed, 26 insertions(+), 24 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 86c03e0..5c988aa 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 2f7c4b2..4d499c9 100644
--- a/libgda/gda-data-model.c
+++ b/libgda/gda-data-model.c
@@ -2475,10 +2475,10 @@ real_gda_data_model_dump_as_string (GdaDataModel *model, gboolean dump_attribute
g_strfreev (cols_str [i]);
g_free (cols_str);
}
- if (n_rows < 0)
- g_string_append_printf (string, _("(error getting data)\n"));
- else
+ 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]