Revision: 4132 http://geany.svn.sourceforge.net/geany/?rev=4132&view=rev Author: elextr Date: 2009-08-27 02:07:44 +0000 (Thu, 27 Aug 2009)
Log Message: ----------- Fix usage of project base dir
Modified Paths: -------------- trunk/ChangeLog trunk/src/build.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-08-27 01:08:30 UTC (rev 4131) +++ trunk/ChangeLog 2009-08-27 02:07:44 UTC (rev 4132) @@ -1,5 +1,12 @@ 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. + + +2009-08-27 Lex Trotman <elextr(at)gmail(dot)com> + * src/build.c: Change make custom and make object to ignore make in base path when reading old project file settings. Changed some indent
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2009-08-27 01:08:30 UTC (rev 4131) +++ trunk/src/build.c 2009-08-27 02:07:44 UTC (rev 4132) @@ -2078,7 +2078,7 @@ GeanyFiletype *ft; GeanyProject *pj; gchar **ftlist; - gchar *value; + gchar *value, *basedir; gboolean bvalue;
if (g_key_file_has_group(config, build_grp_name)) @@ -2171,19 +2171,31 @@ case GEANY_BCS_PROJ: if (non_ft_proj==NULL)non_ft_proj = g_new0(GeanyBuildCommand, build_groups_count[GEANY_GBG_NON_FT]); bvalue = g_key_file_get_boolean(config, "project", "make_in_base_path", NULL); - value = bvalue?"%p":"%d"; + 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 (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(value) ); + setptr(non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_ALL)].entries[GEANY_BC_WORKING_DIR], g_strdup(basedir)); 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("%d") ); + setptr(non_ft_pref[GBO_TO_CMD(GEANY_GBO_CUSTOM)].entries[GEANY_BC_WORKING_DIR], g_strdup(basedir)); 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") ); + 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) + 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) + setptr(exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].entries[GEANY_BC_WORKING_DIR], g_strdup(basedir)); } + g_free(basedir); break; case GEANY_BCS_PREF: if (non_ft_pref==NULL)non_ft_pref = g_new0(GeanyBuildCommand, build_groups_count[GEANY_GBG_NON_FT]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.