diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-09-13 21:32:09 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-09-13 21:32:09 +0000 |
commit | 5d19795077b8327dfa1fdf62c2639247c8643fa4 (patch) | |
tree | a88dd515200c86a81c44e9e586bd07f0109c9612 /pango/modules.c | |
parent | b090edda657f1272fa0fe98596d5918726d83d98 (diff) | |
download | pango-5d19795077b8327dfa1fdf62c2639247c8643fa4.tar.gz |
Err about failing to load engine only once per module.
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.
Diffstat (limited to 'pango/modules.c')
-rw-r--r-- | pango/modules.c | 20 |
1 files changed, 19 insertions, 1 deletions
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; |