[anjuta] language-support-vala: take advantage of the new project API



commit 94cef9e7dcae6f586fd2259c9388e3defde916d8
Author: Abderrahim Kitouni <a kitouni gmail com>
Date:   Mon Dec 19 12:20:06 2011 +0100

    language-support-vala: take advantage of the new project API

 plugins/language-support-vala/plugin.vala |   23 +++++++----------------
 1 files changed, 7 insertions(+), 16 deletions(-)
---
diff --git a/plugins/language-support-vala/plugin.vala b/plugins/language-support-vala/plugin.vala
index d902c18..e061f40 100644
--- a/plugins/language-support-vala/plugin.vala
+++ b/plugins/language-support-vala/plugin.vala
@@ -168,24 +168,15 @@ public class ValaPlugin : Plugin {
 		}
 
 		string[] flags = {};
-		bool found = false;
-		foreach (unowned Anjuta.ProjectProperty prop in current_target.get_properties ()) {
-			if (prop.info.id == "VALAFLAGS") {
-				GLib.Shell.parse_argv (prop.value, out flags);
-				found = true;
-				break;
-			}
-		}
-
-		if (!found) {
+		unowned Anjuta.ProjectProperty prop = current_target.get_property ("VALAFLAGS");
+		if (prop != null && prop != prop.info.property) {
+			GLib.Shell.parse_argv (prop.value, out flags);
+		} else {
 			/* Fall back to AM_VALAFLAGS */
 			var current_group = current_target.parent_type (Anjuta.ProjectNodeType.GROUP);
-			foreach (unowned Anjuta.ProjectProperty prop in current_group.get_properties ()) {
-				if (prop.info.id == "VALAFLAGS") {
-					GLib.Shell.parse_argv (prop.value, out flags);
-					break;
-				}
-			}
+			prop = current_group.get_property ("VALAFLAGS");
+			if (prop != null && prop != prop.info.property)
+				GLib.Shell.parse_argv (prop.value, out flags);
 		}
 
 		string[] packages = {};



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