Re: [PATCH] fix undesirable side effect of adding "visible" menu attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Dec 9, 2010 at 3:11 AM, Jan Beulich <JBeulich@xxxxxxxxxx> wrote:
> This lead to non-selected, non-user-selectable options to be written
> out to .config. This is not only pointless, but also preventing the
> user to be prompted should any of those options eventually become
> visible (e.g. by de-selecting the *_AUTO options the "visible"
> attribute was added for.
>
> Furthermore it is quite logical for the "visible" attribute of a menu
> to control the visibility of all contained prompts, which is what the
> patch does.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
>
> ---
>  scripts/kconfig/menu.c |   14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> --- 2.6.37-rc5/scripts/kconfig/menu.c
> +++ 2.6.37-rc5-kconfig-propagate-visibility/scripts/kconfig/menu.c
> @@ -140,6 +140,20 @@ struct property *menu_add_prop(enum prop
>                }
>                if (current_entry->prompt && current_entry != &rootmenu)
>                        prop_warn(prop, "prompt redefined");
> +
> +               /* Apply all upper menus' visibilities to actual prompts. */
> +               if(type == P_PROMPT) {
> +                       struct menu *menu = current_entry;
> +
> +                       while ((menu = menu->parent) != NULL) {
> +                               if (!menu->visibility)
> +                                       continue;
> +                               prop->visible.expr
> +                                       = expr_alloc_and(prop->visible.expr,
> +                                                        menu->visibility);
> +                       }
> +               }
> +
Shouldn't this better to be done in menu_finalize() ?

I'm not either a big fan of testing `menu->visibility' truth, it is an
expression which should be expended by the proper expr_* accessor to
have less things to fix later.

 - Arnaud

>                current_entry->prompt = prop;
>        }
>        prop->text = prompt;
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux