diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2010-03-29 01:20:33 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2010-08-04 15:13:42 +0200 |
commit | dc1786d8a21ff9e9c41c289a2a4c6fb926ee9dfc (patch) | |
tree | 0ed8c4d3c0904fef7693d861ca3e860ae8abc85e /vala/valapropertyaccessor.vala | |
parent | 54caefae22d8b3a493d07bfc11807fc3d440adc6 (diff) | |
download | vala-dc1786d8a21ff9e9c41c289a2a4c6fb926ee9dfc.tar.gz |
Write CCode attributes for property accessors in VAPI files
Fixes bug 614206.
Diffstat (limited to 'vala/valapropertyaccessor.vala')
-rw-r--r-- | vala/valapropertyaccessor.vala | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala index ca0a1c5a6..ee65a99f8 100644 --- a/vala/valapropertyaccessor.vala +++ b/vala/valapropertyaccessor.vala @@ -96,6 +96,16 @@ public class Vala.PropertyAccessor : Symbol { */ public LocalVariable? result_var { get; set; } + public virtual string get_default_cname () { + var t = (TypeSymbol) prop.parent_symbol; + + if (readable) { + return "%sget_%s".printf (t.get_lower_case_cprefix (), prop.name); + } else { + return "%sset_%s".printf (t.get_lower_case_cprefix (), prop.name); + } + } + /** * The publicly accessible name of the function that performs the * access in C code. @@ -104,14 +114,7 @@ public class Vala.PropertyAccessor : Symbol { if (_cname != null) { return _cname; } - - var t = (TypeSymbol) prop.parent_symbol; - - if (readable) { - return "%sget_%s".printf (t.get_lower_case_cprefix (), prop.name); - } else { - return "%sset_%s".printf (t.get_lower_case_cprefix (), prop.name); - } + return get_default_cname (); } private DataType _value_type; |