diff options
author | Colin Walters <walters@verbum.org> | 2008-08-21 20:59:24 +0000 |
---|---|---|
committer | Colin Walters <walters@src.gnome.org> | 2008-08-21 20:59:24 +0000 |
commit | 5158340a4429ddb65107dcf0d831828e51d2e2a8 (patch) | |
tree | 108273072ec7e54af6740b3de10e228e15cddb75 /giscanner | |
parent | b3fb8a14c00df792f7e4f8676d50f2a5a47867c9 (diff) | |
download | gobject-introspection-5158340a4429ddb65107dcf0d831828e51d2e2a8.tar.gz |
Compute prefix by searching through the symbol for bits rather than going
2008-08-21 Colin Walters <walters@verbum.org>
* giscanner/glibtransformer.py: Compute prefix
by searching through the symbol for bits
rather than going directly from ctype; this fixes
webkit_ namespace.
svn path=/trunk/; revision=446
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/glibtransformer.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/giscanner/glibtransformer.py b/giscanner/glibtransformer.py index c0d18751..89a7bc8a 100644 --- a/giscanner/glibtransformer.py +++ b/giscanner/glibtransformer.py @@ -257,8 +257,13 @@ class GLibTransformer(object): # Look at the original C type (before namespace stripping), without # pointers: GtkButton -> gtk_button_, so we can figure out the # method name - orig_type = target_arg.type.ctype.replace('*', '') - prefix = to_underscores(orig_type).lower() + argtype = target_arg.type.ctype.replace('*', '') + name = self._transformer.strip_namespace_object(argtype) + name_uscore = to_underscores(name).lower() + name_offset = func.symbol.find(name_uscore) + if name_offset < 0: + return None + prefix = func.symbol[:name_offset+len(name_uscore)] else: # Constructors must have _new # Take everything before that as class name |