SF.net SVN: geany:[4133] trunk

elextr at users.sourceforge.net elextr at xxxxx
Thu Aug 27 03:49:20 UTC 2009


Revision: 4133
          http://geany.svn.sourceforge.net/geany/?rev=4133&view=rev
Author:   elextr
Date:     2009-08-27 03:49:19 +0000 (Thu, 27 Aug 2009)

Log Message:
-----------
Change fix to usage of project base dir

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/build.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-08-27 02:07:44 UTC (rev 4132)
+++ trunk/ChangeLog	2009-08-27 03:49:19 UTC (rev 4133)
@@ -1,6 +1,15 @@
 2009-08-27  Lex Trotman  <elextr(at)gmail(dot)com>
 
  * src/build.c
+   Fix implementation of loading old project files with base
+   directories. Use project_make_base_path instead of re-
+   implementing.  Now depends on project.c reading base dir 
+   prior to calling load_build_menu.
+
+
+2009-08-27  Lex Trotman  <elextr(at)gmail(dot)com>
+
+ * src/build.c
    Change usage of project base directory to conform with
    previous documented behavior when loading old project files.
 

Modified: trunk/src/build.c
===================================================================
--- trunk/src/build.c	2009-08-27 02:07:44 UTC (rev 4132)
+++ trunk/src/build.c	2009-08-27 03:49:19 UTC (rev 4133)
@@ -2078,7 +2078,7 @@
 	GeanyFiletype 	*ft;
 	GeanyProject  	*pj;
 	gchar 			**ftlist;
-	gchar 			*value, *basedir;
+	gchar 			*value, *basedir, *makebasedir;
 	gboolean 		 bvalue;
 
 	if (g_key_file_has_group(config, build_grp_name))
@@ -2170,31 +2170,31 @@
 			break;
 		case GEANY_BCS_PROJ:
 			if (non_ft_proj==NULL)non_ft_proj = g_new0(GeanyBuildCommand, build_groups_count[GEANY_GBG_NON_FT]);
+			basedir = project_get_base_path();
+			if (basedir==NULL) basedir = g_strdup("%d");
 			bvalue = g_key_file_get_boolean(config, "project", "make_in_base_path", NULL);
-			if (bvalue)
-			{
-				basedir = g_key_file_get_string(config, "project", "base_path", NULL);
-				if (basedir==NULL || !g_path_is_absolute(basedir))
-					basedir = g_build_filename("%p", basedir, NULL);
-				else
-					basedir = g_strdup(basedir);
-			}
-			else
-				basedir = g_strdup("%d");
+			if (bvalue) makebasedir = g_strdup(basedir);
+			else makebasedir = g_strdup("%d");
 			if (non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_ALL)].old)
-				setptr(non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_ALL)].entries[GEANY_BC_WORKING_DIR], g_strdup(basedir));
+				setptr(non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_ALL)].entries[GEANY_BC_WORKING_DIR], g_strdup(makebasedir));
 			if (non_ft_pref[GBO_TO_CMD(GEANY_GBO_CUSTOM)].old)
-				setptr(non_ft_pref[GBO_TO_CMD(GEANY_GBO_CUSTOM)].entries[GEANY_BC_WORKING_DIR], g_strdup(basedir));
+				setptr(non_ft_pref[GBO_TO_CMD(GEANY_GBO_CUSTOM)].entries[GEANY_BC_WORKING_DIR], g_strdup(makebasedir));
 			if (non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_OBJECT)].old)
 				setptr(non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_OBJECT)].entries[GEANY_BC_WORKING_DIR], g_strdup("%d"));
 			value = g_key_file_get_string(config, "project", "run_cmd", NULL);
 			if (value!=NULL && strlen(value)>0)
 			{
 				if (exec_proj==NULL)exec_proj = g_new0(GeanyBuildCommand, build_groups_count[GEANY_GBG_EXEC]);
-				ASSIGNIF(exec_proj, GEANY_GBO_EXEC, "_Execute", value);
-				if (exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].old)
+				if (!exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].exists)
+				{
+					exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].exists = TRUE;
+					setptr(exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].entries[GEANY_BC_LABEL], g_strdup(_("_Execute")));
+					setptr(exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].entries[GEANY_BC_COMMAND], value);
 					setptr(exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].entries[GEANY_BC_WORKING_DIR], g_strdup(basedir));
+					exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].old = TRUE;
+				}
 			}
+			g_free(makebasedir);
 			g_free(basedir);
 			break;
 		case GEANY_BCS_PREF:


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list