diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-11-11 20:04:06 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-11-11 20:21:27 +0100 |
commit | a9677aa57de0fe0fd5eb23938f562e4ba9b0556b (patch) | |
tree | ff0e7bca89d907c3b2f6eb566bcc464e418e6a84 /vala/valaproperty.vala | |
parent | cccf2ad9f2c6d3bb96af755bbb325bc27f232c10 (diff) | |
download | vala-a9677aa57de0fe0fd5eb23938f562e4ba9b0556b.tar.gz |
Move "blurb", "nick" and "notify" into Property
Diffstat (limited to 'vala/valaproperty.vala')
-rw-r--r-- | vala/valaproperty.vala | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala index 19aad24be..bc6b18efc 100644 --- a/vala/valaproperty.vala +++ b/vala/valaproperty.vala @@ -108,6 +108,48 @@ public class Vala.Property : Symbol, Lockable { public MemberBinding binding { get; set; default = MemberBinding.INSTANCE; } /** + * The nick of this property + */ + public string nick { + get { + if (_nick == null) { + _nick = get_attribute_string ("Description", "nick"); + if (_nick == null) { + _nick = name.replace ("_", "-"); + } + } + return _nick; + } + } + + /** + * The blurb of this property + */ + public string blurb { + get { + if (_blurb == null) { + _blurb = get_attribute_string ("Description", "blurb"); + if (_blurb == null) { + _blurb = name.replace ("_", "-"); + } + } + return _blurb; + } + } + + /** + * Specifies whether this a property triggers a notify. + */ + public bool notify { + get { + if (_notify == null) { + _notify = get_attribute_bool ("CCode", "notify", true); + } + return _notify; + } + } + + /** * Specifies the virtual or abstract property this property overrides. * Reference must be weak as virtual properties set base_property to * themselves. @@ -153,6 +195,9 @@ public class Vala.Property : Symbol, Lockable { private bool base_properties_valid; PropertyAccessor? _get_accessor; PropertyAccessor? _set_accessor; + private string? _nick; + private string? _blurb; + private bool? _notify; /** * Creates a new property. |