diff options
author | Benjamin Otte <otte@src.gnome.org> | 2008-02-06 09:36:47 +0000 |
---|---|---|
committer | Benjamin Otte <otte@src.gnome.org> | 2008-02-06 09:36:47 +0000 |
commit | 21fcca71dc18e7bd4a16b38a6d5cad00846e3b07 (patch) | |
tree | bef8fcc9bdbc00fae93b8dee45475b7ddd0893b1 | |
parent | 6279f2a8914881b7bf08ee82ecb18357f31cfdc5 (diff) |
make GParamGType require the set type during construction instead of using
* gparamspecs.c: (param_gtype_set_default), (param_gtype_validate):
make GParamGType require the set type during construction instead of
using G_TYPE_NONE, which causes issues when setting.
Bug 513073 - g_param_spec_gtype breaks with G_PARAM_CONSTRUCT
svn path=/trunk/; revision=6457
-rw-r--r-- | gobject/ChangeLog | 7 | ||||
-rw-r--r-- | gobject/gparamspecs.c | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gobject/ChangeLog b/gobject/ChangeLog index 983d63445..f5a391dc2 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,10 @@ +2008-02-06 Benjamin Otte <otte@gnome.org> + + * gparamspecs.c: (param_gtype_set_default), (param_gtype_validate): + make GParamGType require the set type during construction instead of + using G_TYPE_NONE, which causes issues when setting. + Bug 513073 - g_param_spec_gtype breaks with G_PARAM_CONSTRUCT + 2008-02-05 18:52:07 Tim Janik <timj@imendio.com> * gtype.c: added recursive mutex to protect class initialization, diff --git a/gobject/gparamspecs.c b/gobject/gparamspecs.c index 30c744b0e..5cbe6054a 100644 --- a/gobject/gparamspecs.c +++ b/gobject/gparamspecs.c @@ -1042,7 +1042,9 @@ static void param_gtype_set_default (GParamSpec *pspec, GValue *value) { - value->data[0].v_long = G_TYPE_NONE; + GParamSpecGType *tspec = G_PARAM_SPEC_GTYPE (pspec); + + value->data[0].v_long = tspec->is_a_type; } static gboolean @@ -1055,7 +1057,7 @@ param_gtype_validate (GParamSpec *pspec, if (tspec->is_a_type != G_TYPE_NONE && !g_type_is_a (gtype, tspec->is_a_type)) { - value->data[0].v_long = G_TYPE_NONE; + value->data[0].v_long = tspec->is_a_type; changed++; } |