Revision: 4146 http://geany.svn.sourceforge.net/geany/?rev=4146&view=rev Author: elextr Date: 2009-09-03 03:40:21 +0000 (Thu, 03 Sep 2009)
Log Message: ----------- Only write filetype config files when build command or regex is actually changed. Removed commented code in src/filetypes.c.
Modified Paths: -------------- trunk/ChangeLog trunk/src/build.c trunk/src/filetypes.c trunk/src/filetypes.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-09-01 17:20:34 UTC (rev 4145) +++ trunk/ChangeLog 2009-09-03 03:40:21 UTC (rev 4146) @@ -1,3 +1,10 @@ +2009-09-03 Lex Trotman <elextr(at)gmail(dot)com> + + * src/build.c, src/filetypes.h, src/filetypes.c + Only write filetype config files when build command or regex is + actually changed. Removed commented code in src/filetypes.c. + + 2009-09-01 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/plugins.c:
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2009-09-01 17:20:34 UTC (rev 4145) +++ trunk/src/build.c 2009-09-03 03:40:21 UTC (rev 4146) @@ -1984,7 +1984,8 @@ prefdsts.fileregexstr = NULL; } prefdsts.nonfileregexstr = ®ex_pref; - build_read_commands(&prefdsts, table_data, response); + if (build_read_commands(&prefdsts, table_data, response) && ft!=NULL) + ft->home_save_needed = TRUE; build_free_fields(table_data);
build_menu_update(doc);
Modified: trunk/src/filetypes.c =================================================================== --- trunk/src/filetypes.c 2009-09-01 17:20:34 UTC (rev 4145) +++ trunk/src/filetypes.c 2009-09-03 03:40:21 UTC (rev 4146) @@ -625,8 +625,6 @@ GeanyFiletype *ft = g_new0(GeanyFiletype, 1);
ft->lang = -2; /* assume no tagmanager parser */ -/* ft->programs = g_new0(struct build_programs, 1); - ft->actions = g_new0(struct build_actions, 1);*/ ft->project_list_entry = -1; /* no entry */
ft->priv = g_new0(GeanyFiletypePrivate, 1); @@ -1323,17 +1321,20 @@ GKeyFile *config_home; gchar *fname, *ext, *data;
- ext = filetypes_get_conf_extension(i); - fname = g_strconcat(conf_prefix, ext, NULL); - g_free(ext); - config_home = g_key_file_new(); - g_key_file_load_from_file(config_home, fname, G_KEY_FILE_KEEP_COMMENTS, NULL); - build_save_menu(config_home, (gpointer)(filetypes[i]), GEANY_BCS_HOME_FT); - data = g_key_file_to_data(config_home, NULL, NULL); - utils_write_file(fname, data); - g_free(data); - g_key_file_free(config_home); - g_free(fname); + if (filetypes[i]->home_save_needed) + { + ext = filetypes_get_conf_extension(i); + fname = g_strconcat(conf_prefix, ext, NULL); + g_free(ext); + config_home = g_key_file_new(); + g_key_file_load_from_file(config_home, fname, G_KEY_FILE_KEEP_COMMENTS, NULL); + build_save_menu(config_home, (gpointer)(filetypes[i]), GEANY_BCS_HOME_FT); + data = g_key_file_to_data(config_home, NULL, NULL); + utils_write_file(fname, data); + g_free(data); + g_key_file_free(config_home); + g_free(fname); + } } g_free(conf_prefix); }
Modified: trunk/src/filetypes.h =================================================================== --- trunk/src/filetypes.h 2009-09-01 17:20:34 UTC (rev 4145) +++ trunk/src/filetypes.h 2009-09-03 03:40:21 UTC (rev 4146) @@ -130,6 +130,7 @@ gint project_list_entry; gchar *projerror_regex_string; gchar *homeerror_regex_string; + gboolean home_save_needed; #endif };
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.