Fix matching of methods named *_get_type()
authorMatthew Booth <mbooth@redhat.com>
Tue, 6 Mar 2012 14:57:01 +0000 (11:57 -0300)
committerJohan Dahlin <jdahlin@litl.com>
Tue, 6 Mar 2012 14:57:22 +0000 (11:57 -0300)
commitab8a6d9694ebd79b202b470c3742e8d521faf722
tree8a7552e3b24cbf12d8e52e8758b3b79c7e8a5608
parentc2fc7cb45243aa9e0e1e5569cc742f69c76a671a
Fix matching of methods named *_get_type()

The code which heuristically turned functions into class methods would always
ignore any function called *_get_type or *_get_gtype. However, the code which
looked for GI metadata functions to execute them was much more comprehensive,
checking not just the name, but also that it had no parameters and that it
returned a GType.

This change abstracts the more comprehensive check into the Function class, and
uses the same check in both places.

https://bugzilla.gnome.org/show_bug.cgi?id=671218
.gitignore
giscanner/ast.py
giscanner/gdumpparser.py
giscanner/maintransformer.py
tests/scanner/GetType-1.0-expected.gir [new file with mode: 0644]
tests/scanner/Makefile.am
tests/scanner/gettype.c [new file with mode: 0644]
tests/scanner/gettype.h [new file with mode: 0644]