[gtk+/parser] cssprovider: Don't propagate deprecation messages to passed-in error



commit b1569f6825f049e38826373aed294302ab706984
Author: Benjamin Otte <otte redhat com>
Date:   Wed May 18 18:35:37 2011 +0200

    cssprovider: Don't propagate deprecation messages to passed-in error
    
    It's an informative message, don't stop parsing the CSS because of it.

 gtk/gtkcssprovider.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 185f885..a27bd0f 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1410,6 +1410,13 @@ gtk_css_provider_propagate_error (GtkCssProvider  *provider,
                                   const GError    *error,
                                   GError         **propagate_to)
 {
+  /* don't fail for deprecations */
+  if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
+    {
+      g_warning ("Theme parsing error: %s:%u:%u: %s", path ? path : "<unknown>", line, position, error->message);
+      return;
+    }
+
   /* we already set an error. And we'd like to keep the first one */
   if (*propagate_to)
     return;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]