From: Luca Bruno Date: Thu, 7 Jul 2011 13:44:10 +0000 (+0200) Subject: On-demand Symbol.deprecated X-Git-Tag: 0.13.2~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=384c5607b79eba5695d796f5fe7f067a4845302b;p=thirdparty%2Fvala.git On-demand Symbol.deprecated --- diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala index 5b1ef12a9..c19819aa8 100644 --- a/vala/valasymbol.vala +++ b/vala/valasymbol.vala @@ -82,7 +82,18 @@ public abstract class Vala.Symbol : CodeNode { /** * Specifies whether this symbol has been deprecated. */ - public bool deprecated { get; set; default = false; } + public bool deprecated { + get { + if (_deprecated == null) { + _deprecated = get_attribute ("Deprecated") != null; + } + return _deprecated; + } + set { + _deprecated = value; + set_attribute ("Deprecated", _deprecated); + } + } /** * Specifies what version this symbol has been deprecated since. @@ -194,6 +205,7 @@ public abstract class Vala.Symbol : CodeNode { private weak Scope _owner; private Scope _scope; private string? _gir_name = null; + private bool? _deprecated; public Symbol (string? name, SourceReference? source_reference, Comment? comment = null) { this.name = name; @@ -481,8 +493,6 @@ public abstract class Vala.Symbol : CodeNode { return; } - deprecated = true; - if (attr.has_argument ("since")) { deprecated_since = attr.get_string ("since"); }