[anjuta] libanjuta: Fix a bug when a property is copied to another node



commit 73b437c82113eaac141fc26bb15652075c76eebe
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Sun Feb 13 17:04:43 2011 +0100

    libanjuta: Fix a bug when a property is copied to another node

 libanjuta/anjuta-project.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/libanjuta/anjuta-project.c b/libanjuta/anjuta-project.c
index 97120b6..8f2a55e 100644
--- a/libanjuta/anjuta-project.c
+++ b/libanjuta/anjuta-project.c
@@ -82,6 +82,7 @@ anjuta_project_property_new (const gchar *name, AnjutaProjectValueType type,
 	prop->value = g_strdup (value);
 	prop->native = native;
 	prop->detail = native->detail;
+	
 	return prop;
 }
 
@@ -729,8 +730,16 @@ anjuta_project_node_remove_property (AnjutaProjectNode *node, AnjutaProjectPrope
 	{
 		removed = (AnjutaProjectProperty *)found->data;
 		node->custom_properties = g_list_delete_link (node->custom_properties, found);
+		/* If name is not owned by the property, remove it as the
+		 * property can be associated with another one, having a
+		 * different name */
+		if ((removed->native != NULL) && (removed->name == removed->native->name))
+		{
+			removed->name = NULL;
+		}
 	}
 
+
 	return removed;
 }
 



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