diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | pango/modules.c | 20 |
2 files changed, 24 insertions, 1 deletions
@@ -1,5 +1,10 @@ 2006-09-13 Behdad Esfahbod <behdad@gnome.org> + * pango/modules.c (pango_engine_pair_get_engine): Err about failing to + load engine only once per module. + +2006-09-13 Behdad Esfahbod <behdad@gnome.org> + Bug 355697 – The IndicOTClassTable of Oriya has a error. * modules/indic/indic-ot-class-tables.c: Compute lastChar from diff --git a/pango/modules.c b/pango/modules.c index 57b13443..2c2b7321 100644 --- a/pango/modules.c +++ b/pango/modules.c @@ -261,7 +261,25 @@ pango_engine_pair_get_engine (PangoEnginePair *pair) } if (!pair->engine) - g_printerr ("Failed to load Pango module for id: '%s'", pair->info.id); + { + /* If a module cannot be used, or doesn't not create an engine + * correctly, we print out an error containing module name and id, + * but to not flood the terminal with zillions of the message, we + * set a flag on the module to only err once per module. + */ + static GQuark warned_quark = 0; + + if (!warned_quark) + warned_quark = g_quark_from_static_string ("pango-module-warned"); + + if (!g_object_get_qdata (G_OBJECT (pair->module), warned_quark)) + { + g_warning ("Failed to load Pango module '%s' for id '%s'", pair->module->path, pair->info.id); + + g_object_set_qdata_full (G_OBJECT (pair->module), warned_quark, + GINT_TO_POINTER (1), NULL); + } + } } return pair->engine; |