[gimp] app: output an error message when iso code parsing failed.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: output an error message when iso code parsing failed.
- Date: Sun, 11 Jun 2017 23:30:00 +0000 (UTC)
commit e23ee850d5d53d400aa54c5d84352eb900ade89b
Author: Jehan <jehan girinstud io>
Date: Mon Jun 12 01:17:17 2017 +0200
app: output an error message when iso code parsing failed.
Thanks to Lionel N. who bugged me with his Windows installation where
the XML file was not found by GIMP. We should output a warning when this
happens so that packagers can detect the issue and the expected
installation path for this dependency.
The reporter wants me to call him "Padawan Lionel" but I won't fall for
it! Or did I? :-D
app/widgets/gimplanguagestore-parser.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/app/widgets/gimplanguagestore-parser.c b/app/widgets/gimplanguagestore-parser.c
index da49e97..96574bf 100644
--- a/app/widgets/gimplanguagestore-parser.c
+++ b/app/widgets/gimplanguagestore-parser.c
@@ -97,6 +97,7 @@ gimp_language_store_parser_init (void)
GHashTable *base_lang_list;
gchar *current_env;
GDir *locales_dir;
+ GError *error = NULL;
GHashTableIter lang_iter;
gpointer key;
@@ -165,7 +166,7 @@ gimp_language_store_parser_init (void)
}
/* Parse ISO-639 file to get full list of language and their names. */
- parse_iso_codes (base_lang_list, NULL);
+ parse_iso_codes (base_lang_list, &error);
/* Generate the localized language names. */
g_hash_table_iter_init (&lang_iter, l10n_lang_list);
@@ -343,6 +344,13 @@ parse_iso_codes (GHashTable *base_lang_list,
#endif
success = gimp_xml_parser_parse_gfile (xml_parser, file, error);
+ if (error && *error)
+ {
+ g_warning ("%s: error parsing '%s': %s\n",
+ G_STRFUNC, g_file_get_path (file),
+ (*error)->message);
+ g_clear_error (error);
+ }
g_object_unref (file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]