diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-10-20 20:37:42 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-11-08 08:56:46 +0100 |
commit | 43e617dd33c335645335a5b68f8658f011de7afc (patch) | |
tree | 52cd65160b9e30176af1651b6bc0f346b408c01e | |
parent | 6dfc56a54544a129e91d11202d5f1c5424d57dab (diff) | |
download | vala-43e617dd33c335645335a5b68f8658f011de7afc.tar.gz |
vala: Clean up PropertyAccessor API
-rw-r--r-- | vala/valapropertyaccessor.vala | 12 | ||||
-rw-r--r-- | vapigen/valagidlparser.vala | 6 |
2 files changed, 8 insertions, 10 deletions
diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala index 5491f5e5f..90048486e 100644 --- a/vala/valapropertyaccessor.vala +++ b/vala/valapropertyaccessor.vala @@ -38,7 +38,7 @@ public class Vala.PropertyAccessor : Subroutine { */ public DataType? value_type { get { return _value_type; } - set { + private set { _value_type = value; if (value != null) { _value_type.parent_node = this; @@ -49,23 +49,23 @@ public class Vala.PropertyAccessor : Subroutine { /** * Specifies whether this accessor may be used to get the property. */ - public bool readable { get; set; } + public bool readable { get; private set; } /** * Specifies whether this accessor may be used to set the property. */ - public bool writable { get; set; } + public bool writable { get; private set; } /** * Specifies whether this accessor may be used to construct the * property. */ - public bool construction { get; set; } + public bool construction { get; private set; } /** * True if the body was automatically generated */ - public bool automatic_body { get; set; } + public bool automatic_body { get; private set; } public override bool has_result { get { return readable; } @@ -74,7 +74,7 @@ public class Vala.PropertyAccessor : Subroutine { /** * Represents the generated value parameter in a set accessor. */ - public Parameter value_parameter { get; set; } + public Parameter value_parameter { get; private set; } private DataType _value_type; diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index 553d1c855..86239f42e 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -2730,12 +2730,10 @@ public class Vala.GIdlParser : CodeVisitor { prop.get_accessor = new PropertyAccessor (true, false, false, prop.property_type.copy (), null, null); } if (prop_node.writable) { - prop.set_accessor = new PropertyAccessor (false, false, false, prop.property_type.copy (), null, null); if (prop_node.construct_only) { - prop.set_accessor.construction = true; + prop.set_accessor = new PropertyAccessor (false, false, true, prop.property_type.copy (), null, null); } else { - prop.set_accessor.writable = true; - prop.set_accessor.construction = prop_node.@construct; + prop.set_accessor = new PropertyAccessor (false, true, prop_node.@construct, prop.property_type.copy (), null, null); } } |