diff options
Diffstat (limited to 'vapigen')
-rw-r--r-- | vapigen/valagidlparser.vala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index e3d072855..d3525b152 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -1668,6 +1668,7 @@ public class Vala.GIdlParser : CodeVisitor { current_data_type = iface; + current_type_symbol_set = new HashSet<string> (str_hash, str_equal); var current_type_func_map = new HashMap<string,weak IdlNodeFunction> (str_hash, str_equal); var current_type_vfunc_map = new HashMap<string,string> (str_hash, str_equal); @@ -1708,6 +1709,25 @@ public class Vala.GIdlParser : CodeVisitor { } } + foreach (Property prop in iface.get_properties ()) { + var getter = "get_%s".printf (prop.name); + + if (prop.get_accessor != null && !current_type_symbol_set.contains (getter)) { + prop.set_attribute ("NoAccessorMethod", true); + } + + var setter = "set_%s".printf (prop.name); + + if (prop.set_accessor != null && prop.set_accessor.writable + && !current_type_symbol_set.contains (setter)) { + prop.set_attribute ("NoAccessorMethod", true); + } + + if (prop.get_attribute ("NoAccessorMethod") != null && prop.get_accessor != null) { + prop.get_accessor.value_type.value_owned = true; + } + } + handle_async_methods (iface); current_data_type = null; |