[gtk+] Warn if a property alias is used



commit f3e4e8660d5f55b29015e4358d09440189f82b99
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Nov 20 20:21:33 2015 -0500

    Warn if a property alias is used
    
    Emit a deprecation warning if a property is not used
    by its official name.

 gtk/gtkcssprovider.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index bda3a91..60a9d3b 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -2485,7 +2485,16 @@ parse_declaration (GtkCssScanner *scanner,
       return;
     }
 
-  if (strcmp (name, "engine") == 0)
+  if (property != NULL && strcmp (name, property->name) != 0)
+    {
+      gtk_css_provider_error (scanner->provider,
+                              scanner,
+                              GTK_CSS_PROVIDER_ERROR,
+                              GTK_CSS_PROVIDER_ERROR_DEPRECATED,
+                              "The '%s' property has been renamed to '%s'",
+                              name, property->name);
+    }
+  else if (strcmp (name, "engine") == 0)
     {
       gtk_css_provider_error (scanner->provider,
                               scanner,


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