[gobject-introspection] scanner: Fix handling of property transfer



commit f132cc5dfb232815f5fefc57fcf565cad51ff1dc
Author: Colin Walters <walters verbum org>
Date:   Wed Jan 5 16:32:44 2011 -0500

    scanner: Fix handling of property transfer
    
    * gdumpparser.py was incorrectly passing the ctype for transfer
    * Property constructor wasn't actually doing anything with passed transfer
    * Parse transfer-ownership in girparser

 giscanner/ast.py         |    5 ++++-
 giscanner/gdumpparser.py |    4 +---
 giscanner/girparser.py   |    6 ++++--
 3 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/giscanner/ast.py b/giscanner/ast.py
index d4f251f..f7906f2 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -947,7 +947,10 @@ class Property(Node):
         self.writable = writable
         self.construct = construct
         self.construct_only = construct_only
-        self.transfer = PARAM_TRANSFER_NONE
+        if transfer is None:
+            self.transfer = PARAM_TRANSFER_NONE
+        else:
+            self.transfer = transfer
 
 
 class Callback(Callable):
diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
index 39440c6..eb43a5f 100644
--- a/giscanner/gdumpparser.py
+++ b/giscanner/gdumpparser.py
@@ -419,9 +419,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide
             node.properties.append(ast.Property(
                 pspec.attrib['name'],
                 ast.Type.create_from_gtype_name(ctype),
-                readable, writable, construct, construct_only,
-                ctype,
-                ))
+                readable, writable, construct, construct_only))
         node.properties = node.properties
 
     def _introspect_signals(self, node, xmlnode):
diff --git a/giscanner/girparser.py b/giscanner/girparser.py
index 6f6518c..bcf68bf 100644
--- a/giscanner/girparser.py
+++ b/giscanner/girparser.py
@@ -415,7 +415,8 @@ class GIRParser(object):
                     return ast.TypeUnknown()
                 return ast.Type(ctype=ctype)
             elif name in ['GLib.List', 'GLib.SList']:
-                subchild = self._find_first_child(typenode, map(_corens, ('callback', 'array', 'varargs', 'type')))
+                subchild = self._find_first_child(typenode,
+                               map(_corens, ('callback', 'array', 'varargs', 'type')))
                 if subchild is not None:
                     element_type = self._parse_type(typenode)
                 else:
@@ -509,7 +510,8 @@ class GIRParser(object):
                         node.attrib.get('readable') != '0',
                         node.attrib.get('writable') == '1',
                         node.attrib.get('construct') == '1',
-                        node.attrib.get('construct-only') == '1')
+                        node.attrib.get('construct-only') == '1',
+                        node.attrib.get('transfer-ownership'))
         self._parse_generic_attribs(node, prop)
         return prop
 



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