[glib] Revert "GObject: prevent installing properties after init"



commit 85e9455f68c6cc6093a1ede1c5f15587bba08b51
Author: Ryan Lortie <desrt desrt ca>
Date:   Fri Jun 6 16:40:15 2014 -0400

    Revert "GObject: prevent installing properties after init"
    
    This reverts commit ddb0ce14215cd62c7a2497d6cf9f2ea63c40ebb5.
    
    Conflicts:
        gobject/gobject.c
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698614

 gobject/gobject.c       |    6 ------
 gobject/gtype-private.h |    1 -
 gobject/gtype.c         |   10 ----------
 3 files changed, 0 insertions(+), 17 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 7e9e467..fe081ab 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -540,9 +540,6 @@ g_object_class_install_property (GObjectClass *class,
   if (CLASS_HAS_DERIVED_CLASS (class))
     g_error ("Attempt to add property %s::%s to class after it was derived", G_OBJECT_CLASS_NAME (class), 
pspec->name);
 
-  if (!g_type_is_in_init (G_OBJECT_CLASS_TYPE (class)))
-    g_warning ("Attempt to add property %s::%s after class was initialised", G_OBJECT_CLASS_NAME (class), 
pspec->name);
-
   class->flags |= CLASS_HAS_PROPS_FLAG;
 
   g_return_if_fail (pspec->flags & (G_PARAM_READABLE | G_PARAM_WRITABLE));
@@ -653,9 +650,6 @@ g_object_class_install_properties (GObjectClass  *oclass,
     g_error ("Attempt to add properties to %s after it was derived",
              G_OBJECT_CLASS_NAME (oclass));
 
-  if (!g_type_is_in_init (G_OBJECT_CLASS_TYPE (oclass)))
-    g_warning ("Attempt to add properties to %s after it was initialised", G_OBJECT_CLASS_NAME (oclass));
-
   oclass_type = G_OBJECT_CLASS_TYPE (oclass);
   parent_type = g_type_parent (oclass_type);
 
diff --git a/gobject/gtype-private.h b/gobject/gtype-private.h
index f441ac4..e599bd9 100644
--- a/gobject/gtype-private.h
+++ b/gobject/gtype-private.h
@@ -70,7 +70,6 @@ void        _g_closure_invoke_va (GClosure       *closure,
                                  int             n_params,
                                  GType          *param_types);
 
-gboolean    g_type_is_in_init    (GType type);
 
 G_END_DECLS
 
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 2afec19..f2356ca 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -4818,13 +4818,3 @@ g_type_ensure (GType type)
   if (G_UNLIKELY (type == (GType)-1))
     g_error ("can't happen");
 }
-
-gboolean
-g_type_is_in_init (GType type)
-{
-  TypeNode *node;
-
-  node = lookup_type_node_I (type);
-
-  return node->data->class.init_state != INITIALIZED;
-}


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