summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2011-01-05 16:32:44 -0500
committerColin Walters <walters@verbum.org>2011-01-05 16:38:36 -0500
commitf132cc5dfb232815f5fefc57fcf565cad51ff1dc (patch)
tree93d80bab62b53f398a6d016cd3c86ef08c2ffd5e
parentf99dee8efd9fd3125273b644b7ebea98626eb664 (diff)
downloadgobject-introspection-f132cc5dfb232815f5fefc57fcf565cad51ff1dc.tar.gz
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
-rw-r--r--giscanner/ast.py5
-rw-r--r--giscanner/gdumpparser.py4
-rw-r--r--giscanner/girparser.py6
3 files changed, 9 insertions, 6 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py
index d4f251f0..f7906f2d 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 39440c60..eb43a5f8 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 6f6518c3..bcf68bfd 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