[anjuta] am-project: Remove complete property when empty



commit 45d3c99cced38fe667face8a0e49d4a364bd4565
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Thu Feb 3 22:33:35 2011 +0100

    am-project: Remove complete property when empty

 plugins/am-project/am-writer.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/plugins/am-project/am-writer.c b/plugins/am-project/am-writer.c
index 1fd10e4..58513ab 100644
--- a/plugins/am-project/am-writer.c
+++ b/plugins/am-project/am-writer.c
@@ -843,7 +843,8 @@ amp_property_delete_token (AmpProject  *project, AnjutaToken *token)
 
 	if (token != NULL)
 	{
-		anjuta_token_set_flags (token, ANJUTA_TOKEN_REMOVED);
+		anjuta_token_remove_list (token);
+		
 		updated = TRUE;
 	}
 
@@ -888,6 +889,8 @@ gboolean amp_project_update_am_property (AmpProject *project, AnjutaProjectNode
 	AnjutaProjectNode *group;
 	AnjutaToken *args;
 
+	g_return_val_if_fail (property->native != NULL, FALSE);
+	
 	/* Find group  of the property */
 	if (anjuta_project_node_get_node_type (node) == ANJUTA_PROJECT_GROUP)
 	{
@@ -897,12 +900,14 @@ gboolean amp_project_update_am_property (AmpProject *project, AnjutaProjectNode
 	{
 		group = anjuta_project_node_parent (node);
 	}
-	
 
-	if ((property->value == NULL) || (*property->value == '\0'))
+	if (((property->native->value == NULL) && ((property->value == NULL) || (*property->value == '\0'))) ||
+	    (g_strcmp0 (property->native->value, property->value) == 0))
 	{
 		/* Remove property */
 		args = amp_property_delete_token (project, ((AmpProperty *)property)->token);
+		
+		anjuta_project_node_remove_property (node, property);
 	}
 	else
 	{



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