[glib] Make ordering for overridden interface properties consistent



commit c75429d0a0564c3620c6f72afea9838f661c4e88
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 3 14:52:16 2010 -0400

    Make ordering for overridden interface properties consistent
    
    g_object_class_list_properties tries to sort the returned list of
    paramspecs by 'type depth' and param_id. But all the overridden
    interface properties have a param_id of 0, so they come out in
    a random order.
    
    Bug 628253.

 gobject/gparam.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gobject/gparam.c b/gobject/gparam.c
index b1a871e..f91e587 100644
--- a/gobject/gparam.c
+++ b/gobject/gparam.c
@@ -1144,7 +1144,13 @@ pspec_compare_id (gconstpointer a,
 {
   const GParamSpec *pspec1 = a, *pspec2 = b;
 
-  return pspec1->param_id < pspec2->param_id ? -1 : pspec1->param_id > pspec2->param_id;
+  if (pspec1->param_id < pspec2->param_id)
+    return -1;
+
+  if (pspec1->param_id > pspec2->param_id)
+    return 1;
+
+  return strcmp (pspec1->name, pspec2->name);
 }
 
 static inline GSList*



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]