[anjuta] am-project: Use properties id in projectparser



commit 210ac2ca3ac7fdba61d19fab5006d04435e6d000
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Fri Nov 4 19:44:34 2011 +0100

    am-project: Use properties id in projectparser

 plugins/am-project/projectparser.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/plugins/am-project/projectparser.c b/plugins/am-project/projectparser.c
index dd913b6..c50358d 100644
--- a/plugins/am-project/projectparser.c
+++ b/plugins/am-project/projectparser.c
@@ -338,7 +338,7 @@ get_file (AnjutaProjectNode *target, const char *id)
 }
 
 static gint
-compare_id (const gchar *id, const gchar *name)
+compare_name (const gchar *id, const gchar *name)
 {
 		const gchar *ptr;
 		gboolean next = FALSE;
@@ -371,8 +371,15 @@ get_project_property (IAnjutaProject *project, AnjutaProjectNode *parent, const
 	{
 		gint miss;
 
-		miss = compare_id (id, ((AnjutaProjectProperty *)item->data)->name);
+		/* Find property based on their id */
+		if (strcmp (id, ((AnjutaProjectProperty *)item->data)->id) == 0)
+		{
+			prop = ((AnjutaProjectProperty *)item->data);
+			break;
+		}
 
+		/* Else use the best name */
+		miss = compare_name (id, ((AnjutaProjectProperty *)item->data)->name);
 		if ((miss >= 0) && (miss < best))
 		{
 			best = miss;
@@ -401,7 +408,7 @@ get_target_type (IAnjutaProject *project, const char *id)
 		{
 			gint miss;
 
-			miss = compare_id (id, info->name);
+			miss = compare_name (id, info->name);
 
 			if ((miss >= 0) && (miss < best))
 			{



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