[anjuta/newproject] Fix projectparser test program after last changes



commit f31b99fa6209c41c29dd123ea01072ad8d4f805b
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Sat May 8 22:36:39 2010 +0200

    Fix projectparser test program after last changes

 plugins/am-project/am-project.c    |    7 +++++++
 plugins/am-project/projectparser.c |   12 +++---------
 2 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index 5ad888d..9af9998 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -2903,6 +2903,13 @@ foreach_node_move (AnjutaProjectNode *g_node, gpointer data)
 		g_object_unref (AMP_SOURCE_DATA (g_node)->base.file);
 		AMP_SOURCE_DATA (g_node)->base.file = new_file;
 		break;
+	case ANJUTA_PROJECT_ROOT:
+		relative = get_relative_path (old_root_file, AMP_GROUP_DATA (g_node)->base.file);
+		new_file = g_file_resolve_relative_path (project->root_file, relative);
+		g_free (relative);
+		g_object_unref (AMP_ROOT_DATA (g_node)->base.file);
+		AMP_ROOT_DATA (g_node)->base.file = new_file;
+		break;
 	default:
 		break;
 	}
diff --git a/plugins/am-project/projectparser.c b/plugins/am-project/projectparser.c
index bf955e0..d8d5825 100644
--- a/plugins/am-project/projectparser.c
+++ b/plugins/am-project/projectparser.c
@@ -248,7 +248,7 @@ list_root (IAnjutaProject *project, AnjutaProjectNode *root)
 static AnjutaProjectNode *
 get_node (IAnjutaProject *project, AnjutaProjectNode *root, const char *path)
 {
-	AnjutaProjectNode *node = NULL;
+	AnjutaProjectNode *node = root;
 
 	if (path != NULL)
 	{
@@ -263,14 +263,7 @@ get_node (IAnjutaProject *project, AnjutaProjectNode *root, const char *path)
 				return NULL;
 			}
 
-			if (node == NULL)
-			{
-				if (child == 0) node = root;
-			}
-			else
-			{
-				node = anjuta_project_node_nth_child (node, child);
-			}
+			node = anjuta_project_node_nth_child (node, child);
 			if (node == NULL)
 			{
 				/* no node */
@@ -453,6 +446,7 @@ main(int argc, char *argv[])
 		else if (g_ascii_strcasecmp (command[0], "add") == 0)
 		{
 			node = get_node (project, root, command[2]);
+			g_message ("get parent node %p node name %s", anjuta_project_node_get_name (node));
 			if (g_ascii_strcasecmp (command[1], "group") == 0)
 			{
 				if ((command[4] != NULL) && (g_ascii_strcasecmp (command[4], "before") == 0))



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