Explicitly sort object interfaces, properties, and signals
authorColin Walters <walters@verbum.org>
Wed, 7 Oct 2009 19:54:05 +0000 (15:54 -0400)
committerColin Walters <walters@verbum.org>
Wed, 7 Oct 2009 20:02:31 +0000 (16:02 -0400)
Previously we were taking this in order from the dumper, which ends up
being some undefined order from GObject.  Just use Node's cmp to sort
them by name explicitly.

This probably doesn't cover all possible instances of this problem,
but these fixes are right.

https://bugzilla.gnome.org/show_bug.cgi?id=597724

giscanner/glibtransformer.py

index 993aee6..5b94ef7 100644 (file)
@@ -746,7 +746,7 @@ class GLibTransformer(object):
         for interface in xmlnode.findall('implements'):
             gitype = self._resolve_gtypename(interface.attrib['name'])
             gt_interfaces.append(gitype)
-        node.interfaces = gt_interfaces
+        node.interfaces = sorted(gt_interfaces)
 
     def _introspect_properties(self, node, xmlnode):
         for pspec in xmlnode.findall('property'):
@@ -762,6 +762,7 @@ class GLibTransformer(object):
                 readable, writable, construct, construct_only,
                 ctype,
                 ))
+        node.properties = sorted(node.properties)
 
     def _introspect_signals(self, node, xmlnode):
         for signal_info in xmlnode.findall('signal'):
@@ -781,6 +782,7 @@ class GLibTransformer(object):
                 param.transfer = 'none'
                 signal.parameters.append(param)
             node.signals.append(signal)
+        node.signals = sorted(node.signals)
 
     # Resolver