trackelement: Sort paramspec by name in list_children_properties
authorThibault Saunier <tsaunier@gnome.org>
Thu, 20 Mar 2014 16:04:31 +0000 (17:04 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Mon, 9 Jun 2014 14:10:41 +0000 (16:10 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=720023

ges/ges-track-element.c

index c422b4e..90b8092 100644 (file)
@@ -282,6 +282,12 @@ ges_track_element_init (GESTrackElement * self)
 
 }
 
+static gint
+compare_gparamspec (GParamSpec ** a, GParamSpec ** b, gpointer udata)
+{
+  return g_strcmp0 ((*a)->name, (*b)->name);
+}
+
 static gfloat
 interpolate_values_for_position (GstTimedValue * first_value,
     GstTimedValue * second_value, guint64 position)
@@ -1253,13 +1259,18 @@ GParamSpec **
 ges_track_element_list_children_properties (GESTrackElement * object,
     guint * n_properties)
 {
+  GParamSpec **ret;
   GESTrackElementClass *class;
 
   g_return_val_if_fail (GES_IS_TRACK_ELEMENT (object), NULL);
 
   class = GES_TRACK_ELEMENT_GET_CLASS (object);
 
-  return class->list_children_properties (object, n_properties);
+  ret = class->list_children_properties (object, n_properties);
+  g_qsort_with_data (ret, *n_properties, sizeof (GParamSpec *),
+      (GCompareDataFunc) compare_gparamspec, NULL);
+
+  return ret;
 }
 
 /**