diff options
author | Jürg Billeter <j@bitron.ch> | 2008-09-26 20:34:10 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-09-26 20:34:10 +0000 |
commit | 2f0a36cd89c24c70fd90469c15bf9dbaf7466f0e (patch) | |
tree | 656e69a64fd72f4df8c5a5df4dd9db0a3edf0e3e | |
parent | 7219ffda017ab5ea6b466e2d580e4fcefa84510f (diff) | |
download | vala-2f0a36cd89c24c70fd90469c15bf9dbaf7466f0e.tar.gz |
Use correct accessor cname for interface implementations of properties
2008-09-26 Jürg Billeter <j@bitron.ch>
* gobject/valaccodeclassbinding.vala:
Use correct accessor cname for interface implementations of
properties inherited from a base class,
based on patch by Florian Brosch, fixes bug 548895
svn path=/trunk/; revision=1787
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | THANKS | 2 | ||||
-rw-r--r-- | gobject/valaccodeclassbinding.vala | 28 |
3 files changed, 31 insertions, 7 deletions
@@ -1,5 +1,13 @@ 2008-09-26 Jürg Billeter <j@bitron.ch> + * gobject/valaccodeclassbinding.vala: + + Use correct accessor cname for interface implementations of + properties inherited from a base class, + based on patch by Florian Brosch, fixes bug 548895 + +2008-09-26 Jürg Billeter <j@bitron.ch> + * gobject-introspection/scanner.c: * gobject-introspection/scannerlexer.l: @@ -2,6 +2,7 @@ The Vala team would like to thank the following contributors: Abderrahim Kitouni Alberto Ruiz +Alexander Bokovoy Alexandre Moreira Alexey Lubimov Ali Sabil @@ -23,6 +24,7 @@ Ed Schouten Emmanuele Bassi Étienne Bersac Evan Nemerson +Florian Brosch Francisco Camenforte Torres Frederik Gabriel Falcão diff --git a/gobject/valaccodeclassbinding.vala b/gobject/valaccodeclassbinding.vala index 3c1fec535..10461e80d 100644 --- a/gobject/valaccodeclassbinding.vala +++ b/gobject/valaccodeclassbinding.vala @@ -563,9 +563,16 @@ public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding { } if (base_class != null && cl_method.parent_symbol != cl) { // method inherited from base class - + + var base_method = cl_method; + if (cl_method.base_method != null) { + base_method = cl_method.base_method; + } else if (cl_method.base_interface_method != null) { + base_method = cl_method.base_interface_method; + } + var ciface = new CCodeIdentifier ("iface"); - init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, m.vfunc_name), new CCodeIdentifier (cl_method.get_cname ())))); + init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, m.vfunc_name), new CCodeIdentifier (base_method.get_cname ())))); } } } @@ -611,15 +618,22 @@ public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding { } if (base_class != null && cl_prop.parent_symbol != cl) { // property inherited from base class - + + var base_property = cl_prop; + if (cl_prop.base_property != null) { + base_property = cl_prop.base_property; + } else if (cl_prop.base_interface_property != null) { + base_property = cl_prop.base_interface_property; + } + var ciface = new CCodeIdentifier ("iface"); - if (prop.get_accessor != null) { - string cname = "%s_real_get_%s".printf (cl.get_lower_case_cname (null), prop.name); + if (base_property.get_accessor != null) { + string cname = base_property.get_accessor.get_cname (); init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, "get_%s".printf (prop.name)), new CCodeIdentifier (cname)))); } - if (prop.set_accessor != null) { - string cname = "%s_real_set_%s".printf (cl.get_lower_case_cname (null), prop.name); + if (base_property.set_accessor != null) { + string cname = base_property.set_accessor.get_cname (); init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, "set_%s".printf (prop.name)), new CCodeIdentifier (cname)))); } } |