On 18/06/12 23:27, Alexey I. Froloff wrote:

> From: "Alexey I. Froloff" <[email protected]>
> 
> Last group from a desktop file is always added to menu regardless of
> NoDisplay property.  Properly handle the NoDisplay and Hidden properties
> at the end of file.
> 
> Signed-off-by: Alexey I. Froloff <[email protected]>
> ---
>  util/wmmenugen_parse_xdg.c |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/util/wmmenugen_parse_xdg.c b/util/wmmenugen_parse_xdg.c
> index f39a83e..16a2fda 100644
> --- a/util/wmmenugen_parse_xdg.c
> +++ b/util/wmmenugen_parse_xdg.c
> @@ -180,9 +180,13 @@ void parse_xdg(const char *file, void 
> (*addWMMenuEntryCallback)(WMMenuEntry *aEn
>  
>       fclose(fp);
>  
> -     /* at the end of the file, might as well try to menuize what we have */
> -     if (xdg_to_wm(&xdg, &wm))
> -             (*addWMMenuEntryCallback)(wm);
> +     if (InGroup) {
> +             /* at the end of the file, might as well try to menuize what we 
> have
> +              * unless there was no group at all or it was marked as hidden
> +              */
> +             if (xdg_to_wm(&xdg, &wm))
> +                     (*addWMMenuEntryCallback)(wm);
> +     }
>  
>  }
>  


Hi Alexey,

why not use "if ((InGroup) && (xdg_to_wm(&xdg, &wm))? You can remove the
curly brackets and put the comments above. Less lines, small patch.
There is other possible option to maintain the "if's" splitted?

Best Regards.
kix


-- 
To unsubscribe, send mail to [email protected].

Reply via email to