]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
On-demand Symbol.deprecated
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 7 Jul 2011 13:44:10 +0000 (15:44 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Mon, 1 Aug 2011 16:17:05 +0000 (18:17 +0200)
vala/valasymbol.vala

index 5b1ef12a979b0e7e88383c3a99849886e3d8018e..c19819aa8c8451ee9b8d207345acde3ada002a96 100644 (file)
@@ -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");
                }