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



commit 17e3d6f85e0f9339d2e7ac347d0dcc160e500cb7
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 ab65804..1f6c7a7 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]