[vala/wip/attributes: 23/37] On-demand Symbol.replacement



commit d816b1ac98e41e4eb538cd28d3b5daa6e3c962e3
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Jul 7 15:49:16 2011 +0200

    On-demand Symbol.replacement

 vala/valasymbol.vala |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index a186b01..6368a05 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -110,7 +110,14 @@ public abstract class Vala.Symbol : CodeNode {
 	/**
 	 * Specifies the replacement if this symbol has been deprecated.
 	 */
-	public string? replacement { get; set; default = null; }
+	public string? replacement {
+		owned get {
+			return get_attribute_string ("Deprecated", "replacement");
+		}
+		set {
+			set_attribute_string ("Deprecated", "replacement", value);
+		}
+	}
 
 	/**
 	 * Specifies whether this symbol is experimental.
@@ -499,10 +506,6 @@ public abstract class Vala.Symbol : CodeNode {
 		if (attr.name != "Deprecated") {
 			return;
 		}
-
-		if (attr.has_argument ("replacement")) {
-			replacement = attr.get_string ("replacement");
-		}
 	}
 
 	/**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]