menu: avoid logging on <item label="" icon="">

Labwc does not support menu icons, but we should not log errors if a
menu file contains icons as in the example below:

<item label="" icon="">
  <action name="Execute">
    <command></command>
  </action>
</item>
This commit is contained in:
Johan Malm 2022-05-06 21:52:46 +01:00
parent b50d0ea4c8
commit 9554be0ce7

View file

@ -167,6 +167,11 @@ fill_item(char *nodename, char *content)
} else if (!current_item) {
wlr_log(WLR_ERROR, "expect <item label=\"\"> element first. "
"nodename: '%s' content: '%s'", nodename, content);
} else if (!strcmp(nodename, "icon")) {
/*
* Do nothing as we don't support menu icons - just avoid
* logging errors if a menu.xml file contains icon="" entries.
*/
} else if (!strcmp(nodename, "name.action")) {
current_item_action = action_create(content);
wl_list_insert(current_item->actions.prev, &current_item_action->link);