Index: trunk/src/conf.c =================================================================== --- trunk/src/conf.c (revision 10815) +++ trunk/src/conf.c (revision 10816) @@ -791,7 +791,7 @@ } int conf_rev = 0; -void conf_update(const char *path) +void conf_update(const char *path, int arr_idx) { conf_native_t *n; @@ -813,6 +813,7 @@ /* It might be an array element - truncate */ field = strrchr(path_, '['); if (field != NULL) { + arr_idx = atoi(field+1); *field = '\0'; n = conf_get_field(path_); } @@ -832,7 +833,7 @@ /* if a valid node is found, update it */ if (n != NULL) - conf_update(path_); + conf_update(path_, arr_idx); free(path_); return; @@ -986,7 +987,7 @@ pc = NULL; if (pc == NULL) conf_reset(CFR_PROJECT, ""); - conf_update(NULL); + conf_update(NULL, -1); } void conf_reg_field_(void *value, int array_size, conf_native_type_t type, const char *path, const char *desc, conf_flag_t flags) @@ -1279,7 +1280,7 @@ res = conf_set_dry(target, path, arr_idx, new_val, pol); if (res < 0) return res; - conf_update(path); + conf_update(path, arr_idx); return 0; } @@ -1289,7 +1290,7 @@ res = conf_set_dry(target, path, arr_idx, NULL, POL_OVERWRITE); if (res < 0) return res; - conf_update(path); + conf_update(path, arr_idx); return 0; } Index: trunk/src/conf.h =================================================================== --- trunk/src/conf.h (revision 10815) +++ trunk/src/conf.h (revision 10816) @@ -163,7 +163,7 @@ void conf_load_project(const char *project_fn, const char *pcb_fn); /* Update the binary representation from the memory-lht representation */ -void conf_update(const char *path); +void conf_update(const char *path, int arr_idx); conf_native_t *conf_get_field(const char *path); void conf_reg_field_(void *value, int array_size, conf_native_type_t type, const char *path, const char *desc, conf_flag_t flags); Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 10815) +++ trunk/src/conf_act.c (revision 10816) @@ -194,7 +194,7 @@ pcb_message(PCB_MSG_ERROR, "Can not toggle '%s': failed to set new value\n", argv[1]); return 1; } - conf_update(argv[1]); + conf_update(argv[1], -1); } else if (PCB_NSTRCMP(cmd, "reset") == 0) { @@ -205,7 +205,7 @@ return 1; } conf_reset(role, ""); - conf_update(argv[1]); + conf_update(argv[1], -1); } else { Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 10815) +++ trunk/src/main.c (revision 10816) @@ -508,7 +508,7 @@ /* plugins may have installed their new fields, reinterpret the config (memory lht -> memory bin) to get the new fields */ - conf_update(NULL); + conf_update(NULL, -1); if (main_action != NULL) { pcb_hid_parse_command(main_action); Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 10815) +++ trunk/src_plugins/export_gerber/gerber.c (revision 10816) @@ -665,7 +665,7 @@ maybe_close_f(f); f = NULL; pcb_hid_restore_layer_ons(save_ons); - conf_update(NULL); /* resotre forced sets */ + conf_update(NULL, -1); /* resotre forced sets */ } static void gerber_parse_arguments(int *argc, char ***argv) Index: trunk/src_plugins/export_openscad/scad.c =================================================================== --- trunk/src_plugins/export_openscad/scad.c (revision 10815) +++ trunk/src_plugins/export_openscad/scad.c (revision 10816) @@ -721,7 +721,7 @@ fprintf(scad_output, "// END_OF_BOARD\n"); fclose(scad_output); quit:; - conf_update(NULL); /* restore forced sets */ + conf_update(NULL, -1); /* restore forced sets */ } static void scad_parse_arguments(int *argc, char ***argv) Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 10815) +++ trunk/src_plugins/export_png/png.c (revision 10816) @@ -621,7 +621,7 @@ pcb_hid_expose_all(&png_hid, &ctx); memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack)); - conf_update(NULL); /* restore forced sets */ + conf_update(NULL, -1); /* restore forced sets */ } static void clip(color_struct * dest, color_struct * source) Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 10815) +++ trunk/src_plugins/export_ps/eps.c (revision 10816) @@ -309,7 +309,7 @@ fprintf(f, "%%%%EOF\n"); memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack)); - conf_update(NULL); /* restore forced sets */ + conf_update(NULL, -1); /* restore forced sets */ } static void eps_do_export(pcb_hid_attr_val_t * options) Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 10815) +++ trunk/src_plugins/export_ps/ps.c (revision 10816) @@ -686,7 +686,7 @@ fprintf(the_file, "showpage\n"); memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack)); - conf_update(NULL); /* restore forced sets */ + conf_update(NULL, -1); /* restore forced sets */ } static void ps_do_export(pcb_hid_attr_val_t * options) Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 10815) +++ trunk/src_plugins/export_svg/svg.c (revision 10816) @@ -239,7 +239,7 @@ gds_init(&snormal); pcb_hid_expose_all(&svg_hid, &ctx); - conf_update(NULL); /* restore forced sets */ + conf_update(NULL, -1); /* restore forced sets */ } static void group_close() Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 10815) +++ trunk/src_plugins/io_lihata/read.c (revision 10816) @@ -1251,7 +1251,7 @@ if (conf_insert_tree_as(CFR_DESIGN, sub) != 0) pcb_message(PCB_MSG_ERROR, "Failed to insert the config subtree found in %s\n", pcb->Filename); else - conf_update(NULL); + conf_update(NULL, -1); } Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 10815) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 10816) @@ -2566,7 +2566,7 @@ /* load config nodes not disabled above, from optional attributes */ io_pcb_attrib_a2c(Ptr); - conf_update(NULL); + conf_update(NULL, -1); } if (retval == 0) { /* restore loader so the next save will use the same units */ Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 10815) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 10816) @@ -425,7 +425,7 @@ /* load config nodes not disabled above, from optional attributes */ io_pcb_attrib_a2c(Ptr); - conf_update(NULL); + conf_update(NULL, -1); } if (retval == 0) { /* restore loader so the next save will use the same units */ Index: trunk/src_plugins/lib_gtk_config/gui-config.c =================================================================== --- trunk/src_plugins/lib_gtk_config/gui-config.c (revision 10815) +++ trunk/src_plugins/lib_gtk_config/gui-config.c (revision 10816) @@ -271,7 +271,7 @@ if (conf_replace_subtree(ctx->dst_role, e->key, ctx->src_role, e->key) != 0) pcb_message(PCB_MSG_ERROR, "Error: failed to save config item %s\n", *p); if (ctx->dst_role < CFR_max_real) { - conf_update(e->key); + conf_update(e->key, -1); need_update++; } } @@ -282,7 +282,7 @@ if (conf_replace_subtree(ctx->dst_role, *p, ctx->src_role, *p) != 0) pcb_message(PCB_MSG_ERROR, "Error: failed to save config item %s\n", *p); if (ctx->dst_role < CFR_max_real) { - conf_update(*p); + conf_update(*p, -1); need_update++; } } @@ -1136,7 +1136,7 @@ static void post_rebuild(gtk_conf_list_t * cl) { - conf_update("rc/library_search_paths"); + conf_update("rc/library_search_paths", -1); } @@ -1352,7 +1352,7 @@ conf_makedirty(ctx->dst_role); } } - conf_update("design/default_layer_name"); + conf_update("design/default_layer_name", -1); conf_set(CFR_DESIGN, "design/groups", -1, s, POL_OVERWRITE); g_free(s); config_any_replace(ctx, paths); @@ -2353,7 +2353,7 @@ conf_set_dry(role, nat->hash_path, -1, pcb_strdup(s), (n == 0) ? POL_OVERWRITE : POL_APPEND); g_free(s); } - conf_update(nat->hash_path); + conf_update(nat->hash_path, -1); config_auto_save(role); } new_val = NULL; /* do not run conf_set, but run the rest of the updates */ Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 10815) +++ trunk/src_plugins/renumber/renumber.c (revision 10816) @@ -298,7 +298,7 @@ fclose(out); /* restore the unique flag setting */ - conf_update(NULL); + conf_update(NULL, -1); if (changed) {