diff options
author | Jonathan Matthew <jonathan@d14n.org> | 2010-11-06 19:45:29 +1000 |
---|---|---|
committer | Jonathan Matthew <jonathan@d14n.org> | 2010-11-16 10:41:40 +1000 |
commit | 52d002019620a50bfd5dfa4e455fb0f9432c3799 (patch) | |
tree | e6a986d7957e0111583308037481e71b86cc522f /giscanner/maintransformer.py | |
parent | 7ac5f0c8ded33e061cd00066a594774ef9b453c7 (diff) | |
download | gobject-introspection-52d002019620a50bfd5dfa4e455fb0f9432c3799.tar.gz |
scanner: use c-symbol-prefix for method pairing where possible
If we have a C symbol prefix for the target type, then use that to
identify methods that should be paired with it. The C symbol prefix
is derived from the name of the _get_type() function, so it's likely
that this is also the prefix given to methods for the type.
https://bugzilla.gnome.org/show_bug.cgi?id=634153
Diffstat (limited to 'giscanner/maintransformer.py')
-rw-r--r-- | giscanner/maintransformer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 89f7ff65..af98a14c 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -915,7 +915,10 @@ method or constructor of some type.""" if first.type.ctype.count('*') != 1: return False - uscored = self._uscored_identifier_for_type(first.type) + if hasattr(target, 'c_symbol_prefix') and target.c_symbol_prefix is not None: + uscored = target.c_symbol_prefix + else: + uscored = self._uscored_identifier_for_type(first.type) if not subsymbol.startswith(uscored): return False func.instance_parameter = func.parameters.pop(0) |