@@ -474,7 +474,7 @@ if ($with_icons) {
474474}
475475
476476sub begin_category {
477- if ($with_icons and defined (my $icon_path = check_icon($_ [1]))) {
477+ if ($with_icons and (my $icon_path = check_icon($_ [1]))) {
478478 <<"MENU_WITH_ICON" ;
479479 <menu id="${\r and()}" icon="$icon_path " label="$_ [0]">
480480MENU_WITH_ICON
@@ -564,7 +564,7 @@ foreach my $schema (@$SCHEMA) {
564564 sort { $a -> [0] cmp $b -> [0] }
565565 map [lc ($_ ) => $_ ],
566566 map {
567- $with_icons
567+ ( $with_icons and $_ -> { Icon })
568568 ? <<"ITEM_WITH_ICON"
569569 <item label="$_ ->{Name}" icon="$_ ->{Icon}"><action name="Execute"><command><![CDATA[$_ ->{Exec}]]></command></action></item>
570570ITEM_WITH_ICON
578578 }
579579 elsif (exists $schema -> {item }) {
580580 my ($command , $label , $icon ) = @{$schema -> {item }};
581- if ($with_icons and defined (my $icon_path = check_icon($icon ))) {
581+ if ($with_icons and (my $icon_path = check_icon($icon ))) {
582582 $generated_menu .= <<"ITEM_WITH_ICON" ;
583583 <item label="$label " icon="$icon_path "><action name="Execute"><command><![CDATA[$command ]]></command></action></item>
584584ITEM_WITH_ICON
609609 }
610610 elsif (exists $schema -> {exit }) {
611611 my ($label , $icon ) = @{$schema -> {exit }};
612- if ($with_icons and defined (my $icon_path = check_icon($icon ))) {
612+ if ($with_icons and (my $icon_path = check_icon($icon ))) {
613613 $generated_menu .= <<"EXIT_WITH_ICON" ;
614614 <item label="$label " icon="$icon_path "><action name="Exit"/></item>
615615EXIT_WITH_ICON
629629 }
630630 elsif (exists $schema -> {pipe }) {
631631 my ($command , $label , $icon ) = @{$schema -> {pipe }};
632- if ($with_icons and defined (my $icon_path = check_icon($icon ))) {
632+ if ($with_icons and (my $icon_path = check_icon($icon ))) {
633633 $generated_menu .= <<"PIPE_WITH_ICON" ;
634634 <menu id="${\r and()}" label="$label " execute="$command " icon="$icon_path "/>
635635PIPE_WITH_ICON
642642 }
643643 elsif (exists $schema -> {obgenmenu }) {
644644 my ($name , $icon ) = ref ($schema -> {obgenmenu }) eq ' ARRAY' ? @{$schema -> {obgenmenu }} : $schema -> {obgenmenu };
645- if ($with_icons and defined (my $icon_path = check_icon($icon ))) {
645+ if ($with_icons and (my $icon_path = check_icon($icon ))) {
646646 $generated_menu .= <<"MENU_WITH_ICON" ;
647647 <menu id="${\r and()}" label="$name " icon="$icon_path ">
648648MENU_WITH_ICON
0 commit comments