[anjuta] libanjuta: Allow changing not only the first property in a map



commit 1d9bc5bbdfc68677861a2f8815e715d08eaff7e3
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Fri Apr 29 22:00:20 2011 +0200

    libanjuta: Allow changing not only the first property in a map

 libanjuta/anjuta-project.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/libanjuta/anjuta-project.c b/libanjuta/anjuta-project.c
index 3e33646..7b08b4d 100644
--- a/libanjuta/anjuta-project.c
+++ b/libanjuta/anjuta-project.c
@@ -681,15 +681,24 @@ anjuta_project_node_get_property (AnjutaProjectNode *node, AnjutaProjectProperty
 AnjutaProjectProperty *
 anjuta_project_node_get_map_property (AnjutaProjectNode *node, AnjutaProjectProperty *property, const gchar *name)
 {
-	GList *found;
+	GList *found = NULL;
 
+	/* Check if the property is already the right one */
+	if (property->native != NULL)
+	{
+		found = g_list_find (node->custom_properties, property);
+	}
+	
 	/* Search in custom properties */
-	found = g_list_find_custom (node->custom_properties, property, find_property);
-	if (name != NULL)
+	if (found == NULL)
 	{
-		while ((found != NULL) && (strcmp (name, ((AnjutaProjectProperty *)found->data)->name) != 0))
+		found = g_list_find_custom (node->custom_properties, property, find_property);
+		if (name != NULL)
 		{
-			found = g_list_find_custom (g_list_next (found), property, find_property);
+			while ((found != NULL) && (strcmp (name, ((AnjutaProjectProperty *)found->data)->name) != 0))
+			{
+				found = g_list_find_custom (g_list_next (found), property, find_property);
+			}
 		}
 	}
 



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