childproxy: fix gir warning

This commit is contained in:
Stefan Sauer 2013-03-29 19:01:59 +01:00
parent 8c542540c2
commit ba8c0f5e4b

View file

@ -163,7 +163,7 @@ gst_child_proxy_get_children_count (GstChildProxy * parent)
/** /**
* gst_child_proxy_lookup: * gst_child_proxy_lookup:
* @childproxy: child proxy object to lookup the property in * @object: child proxy object to lookup the property in
* @name: name of the property to look up * @name: name of the property to look up
* @target: (out) (allow-none) (transfer full): pointer to a #GObject that * @target: (out) (allow-none) (transfer full): pointer to a #GObject that
* takes the real object to set property on * takes the real object to set property on
@ -179,57 +179,57 @@ gst_child_proxy_get_children_count (GstChildProxy * parent)
* usage. For plain GObjects @target is the same as @object. * usage. For plain GObjects @target is the same as @object.
*/ */
gboolean gboolean
gst_child_proxy_lookup (GstChildProxy * childproxy, const gchar * name, gst_child_proxy_lookup (GstChildProxy * object, const gchar * name,
GObject ** target, GParamSpec ** pspec) GObject ** target, GParamSpec ** pspec)
{ {
GObject *object; GObject *obj;
gboolean res = FALSE; gboolean res = FALSE;
gchar **names, **current; gchar **names, **current;
g_return_val_if_fail (GST_IS_CHILD_PROXY (childproxy), FALSE); g_return_val_if_fail (GST_IS_CHILD_PROXY (object), FALSE);
g_return_val_if_fail (name != NULL, FALSE); g_return_val_if_fail (name != NULL, FALSE);
object = g_object_ref (childproxy); obj = g_object_ref (object);
current = names = g_strsplit (name, "::", -1); current = names = g_strsplit (name, "::", -1);
/* find the owner of the property */ /* find the owner of the property */
while (current[1]) { while (current[1]) {
GObject *next; GObject *next;
if (!GST_IS_CHILD_PROXY (object)) { if (!GST_IS_CHILD_PROXY (obj)) {
GST_INFO GST_INFO
("object %s is not a parent, so you cannot request a child by name %s", ("object %s is not a parent, so you cannot request a child by name %s",
(GST_IS_OBJECT (object) ? GST_OBJECT_NAME (object) : ""), current[0]); (GST_IS_OBJECT (obj) ? GST_OBJECT_NAME (obj) : ""), current[0]);
break; break;
} }
next = gst_child_proxy_get_child_by_name (GST_CHILD_PROXY (object), next = gst_child_proxy_get_child_by_name (GST_CHILD_PROXY (obj),
current[0]); current[0]);
if (!next) { if (!next) {
GST_INFO ("no such object %s", current[0]); GST_INFO ("no such object %s", current[0]);
break; break;
} }
g_object_unref (object); g_object_unref (obj);
object = next; obj = next;
current++; current++;
} }
/* look for psec */ /* look for psec */
if (current[1] == NULL) { if (current[1] == NULL) {
GParamSpec *spec = GParamSpec *spec =
g_object_class_find_property (G_OBJECT_GET_CLASS (object), current[0]); g_object_class_find_property (G_OBJECT_GET_CLASS (obj), current[0]);
if (spec == NULL) { if (spec == NULL) {
GST_INFO ("no param spec named %s", current[0]); GST_INFO ("no param spec named %s", current[0]);
} else { } else {
if (pspec) if (pspec)
*pspec = spec; *pspec = spec;
if (target) { if (target) {
g_object_ref (object); g_object_ref (obj);
*target = object; *target = obj;
} }
res = TRUE; res = TRUE;
} }
} }
g_object_unref (object); g_object_unref (obj);
g_strfreev (names); g_strfreev (names);
return res; return res;
} }