using FOO_GET_CLASS(instance) in a GInstanceInitFunc doesn't work because

2004-02-15  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdata.c (gimp_data_init): using
	FOO_GET_CLASS(instance) in a GInstanceInitFunc doesn't work
	because during instance init, the object's class is always set to
	be the class of the currently called init function. Use the second
	parameter of GInstanceInitFunc instead, which is the instance's
	real class. Fixes bug #134274.
This commit is contained in:
Michael Natterer 2004-02-15 11:23:32 +00:00 committed by Michael Natterer
parent 9fb67ad788
commit 0fa17c880c
2 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,12 @@
2004-02-15 Michael Natterer <mitch@gimp.org>
* app/core/gimpdata.c (gimp_data_init): using
FOO_GET_CLASS(instance) in a GInstanceInitFunc doesn't work
because during instance init, the object's class is always set to
be the class of the currently called init function. Use the second
parameter of GInstanceInitFunc instead, which is the instance's
real class. Fixes bug #134274.
2004-02-14 Michael Natterer <mitch@gimp.org>
Fixed lots of QuickMask brokenness by letting the image adjust

View File

@ -58,7 +58,8 @@ enum
static void gimp_data_class_init (GimpDataClass *klass);
static void gimp_data_init (GimpData *data);
static void gimp_data_init (GimpData *data,
GimpDataClass *data_class);
static void gimp_data_finalize (GObject *object);
@ -134,7 +135,8 @@ gimp_data_class_init (GimpDataClass *klass)
}
static void
gimp_data_init (GimpData *data)
gimp_data_init (GimpData *data,
GimpDataClass *data_class)
{
data->filename = NULL;
data->writable = TRUE;
@ -142,8 +144,10 @@ gimp_data_init (GimpData *data)
data->dirty = TRUE;
data->internal = FALSE;
/* if we can't save, we are not writable */
if (! GIMP_DATA_GET_CLASS (data)->save)
/* look at the passed class pointer, not at GIMP_DATA_GET_CLASS(data)
* here, because the latter is always GimpDataClass itself
*/
if (! data_class->save)
data->writable = FALSE;
}