| | 1103 | | static void module_save(const char *module, MODULE_THEME_REC *rec, |
| | 1104 | | THEME_SAVE_REC *data) |
| | 1105 | | { |
| | 1106 | | CONFIG_NODE *fnode, *node; |
| | 1107 | | FORMAT_REC *formats; |
| | 1108 | | int n; |
| | 1109 | | |
| | 1110 | | formats = g_hash_table_lookup(default_formats, rec->name); |
| | 1111 | | if (formats == NULL) return;
|
| | 1112 | | |
| | 1113 | | fnode = config_node_traverse(data->config, "formats", TRUE);
|
| | 1114 | | |
| | 1115 | | node = config_node_section(fnode, rec->name, NODE_TYPE_BLOCK); |
| | 1116 | | for (n = 1; formats[n].def != NULL; n++) {
|
| | 1117 | | if (rec->formats[n] != NULL) {
|
| | 1118 | | config_node_set_str(data->config, node, formats[n].tag, |
| | 1119 | | rec->formats[n]); |
| | 1120 | | } else if (data->save_all && formats[n].tag != NULL) {
|
| | 1121 | | config_node_set_str(data->config, node, formats[n].tag, |
| | 1122 | | formats[n].def); |
| | 1123 | | } |
| | 1124 | | } |
| | 1125 | | |
| | 1126 | | if (node->value == NULL) {
|
| | 1127 | | |
| | 1128 | | config_node_remove(data->config, fnode, node); |
| true | 1129 | | if (fnode->value == NULL) {
|
| data->config->mainnode <= 4095 | 1130 | | config_node_remove(data->config, | Problem | | data->config->mainnode <= 4095 |
|