container: Handle setting children properties that need prefixing
authorThibault Saunier <tsaunier@gnome.org>
Fri, 29 Apr 2016 14:36:00 +0000 (11:36 -0300)
committerThibault Saunier <tsaunier@gnome.org>
Tue, 3 May 2016 11:31:44 +0000 (08:31 -0300)
ges/ges-container.c

index 7c62305..cebaa3e 100644 (file)
@@ -213,14 +213,15 @@ _ges_container_add_child_properties (GESContainer * container,
 
   for (i = 0; i < n_props; i++) {
     GObject *prop_child;
+    gchar *prop_name = g_strdup_printf ("%s::%s",
+        g_type_name (child_props[i]->owner_type),
+        child_props[i]->name);
 
-    if (ges_timeline_element_lookup_child (child, child_props[i]->name,
-            &prop_child, NULL)) {
+    if (ges_timeline_element_lookup_child (child, prop_name, &prop_child, NULL)) {
       ges_timeline_element_add_child_property (GES_TIMELINE_ELEMENT (container),
           child_props[i], prop_child);
-
     }
-
+    g_free (prop_name);
     g_param_spec_unref (child_props[i]);
   }
 
@@ -239,14 +240,17 @@ _ges_container_remove_child_properties (GESContainer * container,
 
   for (i = 0; i < n_props; i++) {
     GObject *prop_child;
+    gchar *prop_name = g_strdup_printf ("%s::%s",
+        g_type_name (child_props[i]->owner_type),
+        child_props[i]->name);
 
-    if (ges_timeline_element_lookup_child (child, child_props[i]->name,
-            &prop_child, NULL)) {
+    if (ges_timeline_element_lookup_child (child, prop_name, &prop_child, NULL)) {
       ges_timeline_element_remove_child_property (GES_TIMELINE_ELEMENT
           (container), child_props[i]);
 
     }
 
+    g_free (prop_name);
     g_param_spec_unref (child_props[i]);
   }
 
@@ -273,12 +277,14 @@ _lookup_child (GESTimelineElement * self, const gchar * prop_name,
 {
   GList *tmp;
 
-  for (tmp = GES_CONTAINER_CHILDREN (self); tmp; tmp = tmp->next)
-    _ges_container_add_child_properties (GES_CONTAINER (self), tmp->data);
+  /* FIXME Implement a synthax to precisely get properties by path */
+  for (tmp = GES_CONTAINER_CHILDREN (self); tmp; tmp = tmp->next) {
 
-  return
-      GES_TIMELINE_ELEMENT_CLASS (ges_container_parent_class)->lookup_child
-      (self, prop_name, child, pspec);
+    if (ges_timeline_element_lookup_child (tmp->data, prop_name, child, pspec))
+      return TRUE;
+  }
+
+  return FALSE;
 }
 
 static GESTrackType