Allow for methods in GLib

* girepository/gitypelib.c: Don't complain about constructors
  returning types other than objects or interfaces if the container
  type isn't an object or interface itself.

* giscanner/glibtransformer.py: Don't give up parsing a method just
  because it's in the GLib namespace.

https://bugzilla.gnome.org/show_bug.cgi?id=621069
This commit is contained in:
Tomeu Vizoso 2010-06-09 10:26:26 +02:00 committed by Johan Dahlin
parent ba97c98827
commit d9bbf572b0

View File

@ -832,13 +832,16 @@ validate_function_blob (ValidateContext *ctx,
iface_type = get_type_blob (typelib, simple, error); iface_type = get_type_blob (typelib, simple, error);
if (!iface_type) if (!iface_type)
return FALSE; return FALSE;
if (!(iface_type->tag == GI_TYPE_TAG_INTERFACE)) if (iface_type->tag != GI_TYPE_TAG_INTERFACE &&
(container_type == BLOB_TYPE_OBJECT ||
container_type == BLOB_TYPE_INTERFACE))
{ {
g_set_error (error, g_set_error (error,
G_TYPELIB_ERROR, G_TYPELIB_ERROR,
G_TYPELIB_ERROR_INVALID, G_TYPELIB_ERROR_INVALID,
"Invalid return type %d for constructor", "Invalid return type '%s' for constructor '%s'",
iface_type->tag); g_type_tag_to_string (iface_type->tag),
get_string_nofail (typelib, blob->symbol));
return FALSE; return FALSE;
} }
} }