[vala/wip/attributes: 100/100] Drop property notify and remaining array_null_terminated



commit 74435b1f79d7af664a59d3d79b5ae0194e3e61ba
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Jul 2 14:19:09 2011 +0200

    Drop property notify and remaining array_null_terminated

 codegen/valaccodebasemodule.vala |    8 ++++++++
 vala/valanamespace.vala          |   28 +++++++---------------------
 vala/valaproperty.vala           |   21 +--------------------
 3 files changed, 16 insertions(+), 41 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index f4a2a78..74a302e 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5865,6 +5865,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 		return m.get_attribute ("ReturnsModifiedPointer") != null;
 	}
 
+	public static bool get_ccode_notify (Property prop) {
+		var a = prop.get_attribute ("CCode");
+		if (a != null && a.has_argument ("notify")) {
+			return a.get_bool ("notify");
+		}
+		return true;
+	}
+
 	public CCodeConstant get_signal_canonical_constant (Signal sig, string? detail = null) {
 		var str = new StringBuilder ("\"");
 
diff --git a/vala/valanamespace.vala b/vala/valanamespace.vala
index e4577ec..f7115ac 100644
--- a/vala/valanamespace.vala
+++ b/vala/valanamespace.vala
@@ -497,26 +497,6 @@ public class Vala.Namespace : Symbol {
 		}
 	}
 
-	private void process_ccode_attribute (Attribute a) {
-		if (a.has_argument ("gir_namespace")) {
-			source_reference.file.gir_namespace = a.get_string ("gir_namespace");
-		}
-		if (a.has_argument ("gir_version")) {
-			source_reference.file.gir_version = a.get_string ("gir_version");
-		}
-	}
-
-	/**
-	 * Process all associated attributes.
-	 */
-	public void process_attributes () {
-		foreach (Attribute a in attributes) {
-			if (a.name == "CCode") {
-				process_ccode_attribute (a);
-			}
-		}
-	}
-
 	public override bool check (CodeContext context) {
 		if (checked) {
 			return !error;
@@ -524,7 +504,13 @@ public class Vala.Namespace : Symbol {
 
 		checked = true;
 
-		process_attributes ();
+		var a = get_attribute ("CCode");
+		if (a.has_argument ("gir_namespace")) {
+			source_reference.file.gir_namespace = a.get_string ("gir_namespace");
+		}
+		if (a.has_argument ("gir_version")) {
+			source_reference.file.gir_version = a.get_string ("gir_version");
+		}
 
 		foreach (Namespace ns in namespaces) {
 			ns.check (context);
diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala
index 802a835..cc1909c 100644
--- a/vala/valaproperty.vala
+++ b/vala/valaproperty.vala
@@ -72,12 +72,6 @@ public class Vala.Property : Symbol, Lockable {
 	public Parameter this_parameter { get; set; }
 
 	/**
-	 * Specifies whether a `notify` signal should be emitted on property
-	 * changes.
-	 */
-	public bool notify { get; set; default = true; }
-
-	/**
 	 * Specifies whether automatic accessor code generation should be
 	 * disabled.
 	 */
@@ -140,8 +134,6 @@ public class Vala.Property : Symbol, Lockable {
 	 */
 	public Expression initializer { get; set; }
 
-	public bool array_null_terminated { get; set; }
-
 	/**
 	 * Nickname of this property.
 	 */
@@ -245,23 +237,12 @@ public class Vala.Property : Symbol, Lockable {
 		return str.str;
 	}
 
-	void process_ccode_attribute (Attribute a) {
-		if (a.has_argument ("notify")) {
-			notify = a.get_bool ("notify");
-		}
-		if (a.has_argument ("array_null_terminated")) {
-			array_null_terminated = a.get_bool ("array_null_terminated");
-		}
-	}
-
 	/**
 	 * Process all associated attributes.
 	 */
 	public void process_attributes () {
 		foreach (Attribute a in attributes) {
-			if (a.name == "CCode") {
-				process_ccode_attribute (a);
-			} else if (a.name == "Description") {
+			if (a.name == "Description") {
 				if (a.has_argument ("nick")) {
 					nick = a.get_string ("nick");
 				}



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