285 |
group->icon = |
group->icon = |
286 |
josm_icon_name_adjust((char*)xmlGetProp(a_node, BAD_CAST "icon")); |
josm_icon_name_adjust((char*)xmlGetProp(a_node, BAD_CAST "icon")); |
287 |
|
|
288 |
/* TODO: sum up bits from all subentries so the main entry vanishes */ |
group->type = 0; |
|
/* if none of the subentries matches (empty subs are not displayed) */ |
|
|
group->type = PRESETS_TYPE_ALL; |
|
289 |
|
|
290 |
presets_item_t **preset = &group->group; |
presets_item_t **preset = &group->group; |
291 |
|
|
293 |
if (cur_node->type == XML_ELEMENT_NODE) { |
if (cur_node->type == XML_ELEMENT_NODE) { |
294 |
if(strcasecmp((char*)cur_node->name, "item") == 0) { |
if(strcasecmp((char*)cur_node->name, "item") == 0) { |
295 |
*preset = parse_item(doc, cur_node); |
*preset = parse_item(doc, cur_node); |
296 |
if(*preset) preset = &((*preset)->next); |
if(*preset) { |
297 |
|
group->type |= (*preset)->type; |
298 |
|
preset = &((*preset)->next); |
299 |
|
} |
300 |
} else if(strcasecmp((char*)cur_node->name, "group") == 0) { |
} else if(strcasecmp((char*)cur_node->name, "group") == 0) { |
301 |
*preset = parse_group(doc, cur_node); |
*preset = parse_group(doc, cur_node); |
302 |
if(*preset) preset = &((*preset)->next); |
if(*preset) { |
303 |
|
group->type |= (*preset)->type; |
304 |
|
preset = &((*preset)->next); |
305 |
|
} |
306 |
} else if(strcasecmp((char*)cur_node->name, "separator") == 0) { |
} else if(strcasecmp((char*)cur_node->name, "separator") == 0) { |
307 |
*preset = g_new0(presets_item_t, 1); |
*preset = g_new0(presets_item_t, 1); |
308 |
preset = &((*preset)->next); |
preset = &((*preset)->next); |
310 |
printf("found unhandled annotations/group/%s\n", cur_node->name); |
printf("found unhandled annotations/group/%s\n", cur_node->name); |
311 |
} |
} |
312 |
} |
} |
313 |
|
|
314 |
|
|
315 |
|
|
316 |
return group; |
return group; |
317 |
} |
} |
318 |
|
|