mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 22:52:09 +01:00
invoke GObjectClass.constructed() only for newly constructed objects, and
Tue Apr 3 12:34:14 2007 Tim Janik <timj@gtk.org> * gobject.[hc]: invoke GObjectClass.constructed() only for newly constructed objects, and invoke it while the notify queue is still being frozen, after all CONSTRUCT* properties have been set and before random other properties are being set. * applied modified patch from Ryan Lortie to implement GObjectClass.constructed() to fix #425324. 2007-04-02 Ryan Lortie <desrt@desrt.ca> * gobject/gobject.h: Add 'constructed' vcall to GObjectClass. * gobject/gobject.c (g_object_newv): call ->constructed() as last step of object construction. svn path=/trunk/; revision=5441
This commit is contained in:
parent
e3562e543a
commit
dac885cba5
@ -1,3 +1,19 @@
|
|||||||
|
Tue Apr 3 12:34:14 2007 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* gobject.[hc]: invoke GObjectClass.constructed() only for newly
|
||||||
|
constructed objects, and invoke it while the notify queue is
|
||||||
|
still being frozen, after all CONSTRUCT* properties have been
|
||||||
|
set and before random other properties are being set.
|
||||||
|
|
||||||
|
* applied modified patch from Ryan Lortie to implement
|
||||||
|
GObjectClass.constructed() to fix #425324.
|
||||||
|
|
||||||
|
2007-04-02 Ryan Lortie <desrt@desrt.ca>
|
||||||
|
|
||||||
|
* gobject/gobject.h: Add 'constructed' vcall to GObjectClass.
|
||||||
|
* gobject/gobject.c (g_object_newv): call ->constructed() as last
|
||||||
|
step of object construction.
|
||||||
|
|
||||||
2007-03-16 Matthias Clasen <mclasen@redhat.com>
|
2007-03-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* === Released 2.13.0 ===
|
* === Released 2.13.0 ===
|
||||||
|
@ -950,6 +950,10 @@ g_object_newv (GType object_type,
|
|||||||
if (newly_constructed)
|
if (newly_constructed)
|
||||||
g_object_notify_queue_thaw (object, nqueue);
|
g_object_notify_queue_thaw (object, nqueue);
|
||||||
|
|
||||||
|
/* run 'constructed' handler if there is one */
|
||||||
|
if (newly_constructed && class->constructed)
|
||||||
|
class->constructed (object);
|
||||||
|
|
||||||
/* set remaining properties */
|
/* set remaining properties */
|
||||||
for (i = 0; i < n_oparams; i++)
|
for (i = 0; i < n_oparams; i++)
|
||||||
object_set_property (object, oparams[i].pspec, oparams[i].value, nqueue);
|
object_set_property (object, oparams[i].pspec, oparams[i].value, nqueue);
|
||||||
@ -958,6 +962,7 @@ g_object_newv (GType object_type,
|
|||||||
/* release our own freeze count and handle notifications */
|
/* release our own freeze count and handle notifications */
|
||||||
if (newly_constructed || n_oparams)
|
if (newly_constructed || n_oparams)
|
||||||
g_object_notify_queue_thaw (object, nqueue);
|
g_object_notify_queue_thaw (object, nqueue);
|
||||||
|
|
||||||
if (unref_class)
|
if (unref_class)
|
||||||
g_type_class_unref (unref_class);
|
g_type_class_unref (unref_class);
|
||||||
|
|
||||||
|
@ -87,10 +87,11 @@ struct _GObjectClass
|
|||||||
GSList *construct_properties;
|
GSList *construct_properties;
|
||||||
|
|
||||||
/*< public >*/
|
/*< public >*/
|
||||||
/* overridable methods */
|
/* seldomly overidden */
|
||||||
GObject* (*constructor) (GType type,
|
GObject* (*constructor) (GType type,
|
||||||
guint n_construct_properties,
|
guint n_construct_properties,
|
||||||
GObjectConstructParam *construct_properties);
|
GObjectConstructParam *construct_properties);
|
||||||
|
/* overridable methods */
|
||||||
void (*set_property) (GObject *object,
|
void (*set_property) (GObject *object,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
@ -101,18 +102,20 @@ struct _GObjectClass
|
|||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
void (*dispose) (GObject *object);
|
void (*dispose) (GObject *object);
|
||||||
void (*finalize) (GObject *object);
|
void (*finalize) (GObject *object);
|
||||||
|
|
||||||
/* seldomly overidden */
|
/* seldomly overidden */
|
||||||
void (*dispatch_properties_changed) (GObject *object,
|
void (*dispatch_properties_changed) (GObject *object,
|
||||||
guint n_pspecs,
|
guint n_pspecs,
|
||||||
GParamSpec **pspecs);
|
GParamSpec **pspecs);
|
||||||
|
|
||||||
/* signals */
|
/* signals */
|
||||||
void (*notify) (GObject *object,
|
void (*notify) (GObject *object,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
|
/* called when done constructing */
|
||||||
|
void (*constructed) (GObject *object);
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
/* padding */
|
/* padding */
|
||||||
gpointer pdummy[8];
|
gpointer pdummy[7];
|
||||||
};
|
};
|
||||||
struct _GObjectConstructParam
|
struct _GObjectConstructParam
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user