mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
Property accessors work for interfaces and objects
We need to check the container type before trying to obtain a GIPropertyInfo for GIFunctionInfos that have a SETTER or a GETTER flag set.
This commit is contained in:
parent
d127fc1136
commit
efa58b3f8d
@ -165,18 +165,30 @@ g_function_info_get_flags (GIFunctionInfo *info)
|
||||
GIPropertyInfo *
|
||||
g_function_info_get_property (GIFunctionInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo;
|
||||
GIRealInfo *rinfo, *container_rinfo;
|
||||
FunctionBlob *blob;
|
||||
GIInterfaceInfo *container;
|
||||
|
||||
g_return_val_if_fail (info != NULL, NULL);
|
||||
g_return_val_if_fail (GI_IS_FUNCTION_INFO (info), NULL);
|
||||
|
||||
rinfo = (GIRealInfo *)info;
|
||||
blob = (FunctionBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
container = (GIInterfaceInfo *)rinfo->container;
|
||||
container_rinfo = (GIRealInfo *)rinfo->container;
|
||||
|
||||
return g_interface_info_get_property (container, blob->index);
|
||||
if (container_rinfo->type == GI_INFO_TYPE_INTERFACE)
|
||||
{
|
||||
GIInterfaceInfo *container = (GIInterfaceInfo *)rinfo->container;
|
||||
|
||||
return g_interface_info_get_property (container, blob->index);
|
||||
}
|
||||
else if (container_rinfo->type == GI_INFO_TYPE_OBJECT)
|
||||
{
|
||||
GIObjectInfo *container = (GIObjectInfo *)rinfo->container;
|
||||
|
||||
return g_object_info_get_property (container, blob->index);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user