[gtk+] css node declaration: Allow both name and type to be set



commit d1a85fc9e49a0afa3cafc3aec98264d65a630f18
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Oct 22 20:58:52 2015 -0400

    css node declaration: Allow both name and type to be set
    
    The widget path machinery assumes that we always have types,
    and without this change, it will start spewing warnings when
    we start to introduce node names.

 gtk/gtkcssnodedeclaration.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcssnodedeclaration.c b/gtk/gtkcssnodedeclaration.c
index 6d861fb..1c5187b 100644
--- a/gtk/gtkcssnodedeclaration.c
+++ b/gtk/gtkcssnodedeclaration.c
@@ -170,12 +170,10 @@ gboolean
 gtk_css_node_declaration_set_type (GtkCssNodeDeclaration **decl,
                                    GType                   type)
 {
-  if ((*decl)->type == type &&
-      (*decl)->name == NULL)
+  if ((*decl)->type == type)
     return FALSE;
 
   gtk_css_node_declaration_make_writable (decl);
-  (*decl)->name = NULL;
   (*decl)->type = type;
 
   return TRUE;
@@ -191,12 +189,10 @@ gboolean
 gtk_css_node_declaration_set_name (GtkCssNodeDeclaration   **decl,
                                    /*interned*/ const char  *name)
 {
-  if ((*decl)->type == 0 &&
-      (*decl)->name == name)
+  if ((*decl)->name == name)
     return FALSE;
 
   gtk_css_node_declaration_make_writable (decl);
-  (*decl)->type = 0;
   (*decl)->name = name;
 
   return TRUE;


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