[anjuta] am-project: bgo #652778 - Opening an automake based project with empty configure.in file fails



commit 0fd0b7f0d24163e30c8581b1b79656dbd78a5163
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Sat Jun 18 12:20:33 2011 +0200

    am-project: bgo #652778 - Opening an automake based project with empty configure.in file fails

 libanjuta/anjuta-token-file.c                      |    8 ++++----
 plugins/am-project/am-project.c                    |    5 +++--
 plugins/build-basic-autotools/configuration-list.c |    2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/libanjuta/anjuta-token-file.c b/libanjuta/anjuta-token-file.c
index 22fb192..7284eff 100644
--- a/libanjuta/anjuta-token-file.c
+++ b/libanjuta/anjuta-token-file.c
@@ -110,13 +110,13 @@ anjuta_token_file_load (AnjutaTokenFile *file, GError **error)
 
 	anjuta_token_file_unload (file);
 	
-	file->save = anjuta_token_new_static (ANJUTA_TOKEN_FILE,  NULL);
-	file->content = anjuta_token_new_static (ANJUTA_TOKEN_FILE,  NULL);
-
 	if (g_file_load_contents (file->file, NULL, &content, &length, NULL, error))
 	{
 		AnjutaToken *token;
-			
+	
+		file->save = anjuta_token_new_static (ANJUTA_TOKEN_FILE,  NULL);
+		file->content = anjuta_token_new_static (ANJUTA_TOKEN_FILE,  NULL);
+
 		token =	anjuta_token_new_string_len (ANJUTA_TOKEN_FILE, content, length);
 		anjuta_token_prepend_child (file->save, token);
 		
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index 69ec5a4..9a1d5eb 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -453,6 +453,7 @@ amp_project_clear (AmpProject *project)
 	if (project->configure_file != NULL) anjuta_token_file_free (project->configure_file);
 	project->configure_file = NULL;
 	if (project->configure_token) anjuta_token_free (project->configure_token);
+	project->configure_token = NULL;
 }
 
 static void
@@ -520,7 +521,6 @@ AnjutaToken*
 amp_project_get_configure_token (AmpProject *project)
 {
 	return project->configure_token;
-
 }
 
 AnjutaToken *
@@ -1644,6 +1644,7 @@ amp_project_load_root (AmpProject *project, GError **error)
 	scanner = amp_ac_scanner_new (project);
 	project->configure_token = amp_ac_scanner_parse_token (scanner, arg, 0, &err);
 	amp_ac_scanner_free (scanner);
+	
 	if (project->configure_token == NULL)
 	{
 		g_set_error (error, IANJUTA_PROJECT_ERROR, 
@@ -2247,7 +2248,7 @@ static gboolean
 iproject_load_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **error)
 {
 	PmJob *load_job;
-	
+
 	if (node == NULL) node = ANJUTA_PROJECT_NODE (obj);
 	if (AMP_PROJECT (obj)->queue == NULL) AMP_PROJECT (obj)->queue = pm_command_queue_new ();
 
diff --git a/plugins/build-basic-autotools/configuration-list.c b/plugins/build-basic-autotools/configuration-list.c
index 56c95db..9039416 100644
--- a/plugins/build-basic-autotools/configuration-list.c
+++ b/plugins/build-basic-autotools/configuration-list.c
@@ -403,7 +403,7 @@ build_configuration_list_set_build_uri (BuildConfigurationList *list, BuildConfi
 gchar *
 build_configuration_list_get_build_uri (BuildConfigurationList *list, BuildConfiguration *cfg)
 {
-	if (cfg->build_uri != NULL)
+	if ((list->project_root_uri != NULL) && (cfg->build_uri != NULL))
 	{
 		GFile *root;
 		GFile *build;



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