]> git.mdlowis.com Git - proto/labwc.git/commitdiff
menu: avoid logging on <item label="" icon="">
authorJohan Malm <jgm323@gmail.com>
Fri, 6 May 2022 20:52:46 +0000 (21:52 +0100)
committerJohan Malm <jgm323@gmail.com>
Fri, 6 May 2022 20:52:46 +0000 (21:52 +0100)
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>

src/menu/menu.c

index 8bfb29f23a8910d89ccc34088ab2d233f74bb444..fda73ceee3764ff5dda0914a7542b5df9d2a0489 100644 (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);