Diff of /trunk/src/josm_presets.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 52 by harbaum, Fri Feb 6 08:14:09 2009 UTC revision 53 by harbaum, Fri Feb 6 09:00:44 2009 UTC
# Line 285  static presets_item_t *parse_group(xmlDo Line 285  static presets_item_t *parse_group(xmlDo
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    
# Line 295  static presets_item_t *parse_group(xmlDo Line 293  static presets_item_t *parse_group(xmlDo
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);
# Line 306  static presets_item_t *parse_group(xmlDo Line 310  static presets_item_t *parse_group(xmlDo
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    

Legend:
Removed from v.52  
changed lines
  Added in v.53