[vala/wip/attributes: 113/119] Drop process_attributes from Signal



commit 0e7926d1c29fbaa67eb25fafd8c584b2710cb924
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Jul 3 19:34:19 2011 +0200

    Drop process_attributes from Signal

 codegen/valagsignalmodule.vala |   13 +++++----
 vala/valaproperty.vala         |    3 --
 vala/valasignal.vala           |   53 ----------------------------------------
 3 files changed, 7 insertions(+), 62 deletions(-)
---
diff --git a/codegen/valagsignalmodule.vala b/codegen/valagsignalmodule.vala
index fade595..91ebe44 100644
--- a/codegen/valagsignalmodule.vala
+++ b/codegen/valagsignalmodule.vala
@@ -310,26 +310,27 @@ public class Vala.GSignalModule : GObjectModule {
 		csignew.add_argument (new CCodeConstant ("\"%s\"".printf (get_ccode_name (sig))));
 		csignew.add_argument (new CCodeIdentifier (get_ccode_type_id (type)));
 		string[] flags = new string[0];
-		if (sig.run_type == "first") {
+		var run_type = sig.get_attribute_string ("Signal", "run");
+		if (run_type == "first") {
 			flags += "G_SIGNAL_RUN_FIRST";
-		} else if (sig.run_type == "cleanup") {
+		} else if (run_type == "cleanup") {
 			flags += "G_SIGNAL_RUN_CLEANUP";
 		} else {
 			flags += "G_SIGNAL_RUN_LAST";
 		}
-		if (sig.is_detailed) {
+		if (sig.get_attribute_bool ("Signal", "detailed")) {
 			flags += "G_SIGNAL_DETAILED";
 		}
 
-		if (sig.no_recurse) {
+		if (sig.get_attribute_bool ("Signal", "no_recurse")) {
 			flags += "G_SIGNAL_NO_RECURSE";
 		}
 
-		if (sig.is_action) {
+		if (sig.get_attribute_bool ("Signal", "action")) {
 			flags += "G_SIGNAL_ACTION";
 		}
 
-		if (sig.no_hooks) {
+		if (sig.get_attribute_bool ("Signal", "no_hooks")) {
 			flags += "G_SIGNAL_NO_HOOKS";
 		}
 
diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala
index 81bf994..7816020 100644
--- a/vala/valaproperty.vala
+++ b/vala/valaproperty.vala
@@ -138,9 +138,6 @@ public class Vala.Property : Symbol, Lockable {
 
 	private DataType _data_type;
 
-	private string? _nick;
-	private string? _blurb;
-
 	private weak Property _base_property;
 	private Property _base_interface_property;
 	private bool base_properties_valid;
diff --git a/vala/valasignal.vala b/vala/valasignal.vala
index a9d31ba..db029e2 100644
--- a/vala/valasignal.vala
+++ b/vala/valasignal.vala
@@ -59,17 +59,6 @@ public class Vala.Signal : Symbol, Lockable {
 	 * */
 	public Method default_handler { get; private set; }
 
-	public bool is_detailed { get; set; }
-
-	public bool no_recurse { get; set; }
-
-	public string run_type { get; set; }
-
-	public bool is_action { get; set; }
-
-	public bool no_hooks { get; set; }
-
-
 	private bool lock_used = false;
 
 	private DataType _return_type;
@@ -87,7 +76,6 @@ public class Vala.Signal : Symbol, Lockable {
 	public Signal (string name, DataType return_type, SourceReference? source_reference = null, Comment? comment = null) {
 		base (name, source_reference, comment);
 		this.return_type = return_type;
-		this.run_type = "last";
 	}
 	
 	/**
@@ -172,45 +160,6 @@ public class Vala.Signal : Symbol, Lockable {
 			default_handler.accept (visitor);
 		}
 	}
-
-	void process_signal_attribute (Attribute a) {
-		if (a.has_argument ("detailed")) {
-			is_detailed = a.get_bool ("detailed");
-		}
-		if (a.has_argument ("no_recurse")) {
-			no_recurse = a.get_bool ("no_recurse");
-		}
-		if (a.has_argument ("run")) {
-			var arg = a.get_string ("run");
-			if (arg == "first") {
-				run_type = "first";
-			} else if (arg == "last") {
-				run_type = "last";
-			} else if (arg == "cleanup") {
-				run_type = "cleanup";
-			}
-		}
-
-		if (a.has_argument ("action")) {
-			is_action = a.get_bool ("action");
-		}
-
-		if (a.has_argument ("no_hooks")) {
-			no_hooks = a.get_bool ("no_hooks");
-		}
-	}
-
-	/**
-	 * Process all associated attributes.
-	 */
-	public void process_attributes () {
-		foreach (Attribute a in attributes) {
-			if (a.name == "Signal") {
-				process_signal_attribute (a);
-			}
-		}
-	}
-	
 	public bool get_lock_used () {
 		return lock_used;
 	}
@@ -232,8 +181,6 @@ public class Vala.Signal : Symbol, Lockable {
 
 		checked = true;
 
-		process_attributes ();
-
 		return_type.check (context);
 		
 		foreach (Parameter param in parameters) {



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