[gnome-software] Avoid CSS deprecation warnings



commit 8b8e24ffbf4b69c87839dacb2f3d6c3349429bfb
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 6 13:31:55 2016 +0100

    Avoid CSS deprecation warnings
    
    This is temporary until we can update the CSS.

 src/gs-application.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 8a177d3..3136217 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -270,6 +270,16 @@ theme_changed (GtkSettings *settings, GParamSpec *pspec, GsApplication *app)
 }
 
 static void
+css_error (GtkCssProvider *provider,
+           GtkCssSection  *section,
+           const GError   *error,
+           gpointer        data)
+{
+  if (!g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
+    g_error ("CSS parsing error: %s", error->message);
+}
+
+static void
 gs_application_initialize_ui (GsApplication *app)
 {
        static gboolean initialized = FALSE;
@@ -285,6 +295,11 @@ gs_application_initialize_ui (GsApplication *app)
                                                   GTK_STYLE_PROVIDER (app->provider),
                                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 
+       /* This is to avoid CSS deprecation warnings until we can update
+        * the CSS to not use deprecated selectors.
+        */
+       g_signal_connect (app->provider, "parsing-error", G_CALLBACK (css_error), NULL);
+
        g_signal_connect (gtk_settings_get_default (), "notify::gtk-theme-name",
                          G_CALLBACK (theme_changed), app);
        theme_changed (gtk_settings_get_default (), NULL, app);


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