[gtk+/parser: 46/74] cssprovider: Emit a g_warning() when a css file is erroneous
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/parser: 46/74] cssprovider: Emit a g_warning() when a css file is erroneous
- Date: Mon, 9 May 2011 15:26:37 +0000 (UTC)
commit f366345ca4612611c3af9279713da12576c14dbb
Author: Benjamin Otte <otte redhat com>
Date: Mon Apr 11 01:51:49 2011 +0200
cssprovider: Emit a g_warning() when a css file is erroneous
... and no other error handler is active. See the source code comment
for the reasoning.
gtk/gtkcssprovider.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 03d5cd1..771f898 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -876,6 +876,20 @@ gtk_css_provider_parsing_error (GtkCssProvider *provider,
priv->error = g_error_copy (error);
g_prefix_error (&priv->error, "%s:%u:%u: ", path ? path : "<unknown>", line, position);
}
+
+ /* Only emit a warning when we have no error handlers. This is our
+ * default handlers. And in this case erroneous CSS files are a bug
+ * and should be fixed.
+ * Note that these warnings can also be triggered by a broken theme
+ * that people installed from some weird location on the internets.
+ */
+ if (!g_signal_has_handler_pending (provider,
+ css_provider_signals[PARSING_ERROR],
+ 0,
+ TRUE))
+ {
+ g_warning ("Theme parsing error: %s:%u:%u: %s", path ? path : "<unknown>", line, position, error->message);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]