[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-kbuild
Subject: Re: [PATCH v2] mconf/nconf: mark empty menus/menuconfigs different from non-empty ones
From: "Yann E. MORIN" <yann.morin.1998 () free ! fr>
Date: 2013-05-19 15:14:17
Message-ID: 20130519151417.GB3339 () free ! fr
[Download RAW message or body]
Dirk, All,
On 2013-05-17 14:42 +0200, Dirk Gouders spake thusly:
> Submenus are sometimes empty and it would be nice if there is
> something that notifies us that we should not expect any content
> _before_ we enter a submenu.
>
> A new function menu_is_empty() was introduced and empty menus and
> menuconfigs are now marked by "----" as opposed to non-empty
> ones that are marked by "--->".
>
> This scheme was suggested by "Yann E. MORIN" <yann.morin.1998@free.fr>.
>
> Signed-off-by: Dirk Gouders <dirk@gouders.net>
> ---
[--SNIP--]
> diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
> index ccb71ae..80b289c 100644
> --- a/scripts/kconfig/mconf.c
> +++ b/scripts/kconfig/mconf.c
[--SNIP--]
> @@ -497,9 +497,14 @@ static void build_conf(struct menu *menu)
> item_make("%s%*c%s",
> menu->data ? "-->" : "++>",
> indent + 1, ' ', prompt);
> - } else
> - item_make(" %*c%s --->", indent + 1, ' ', prompt);
> -
> + } else {
> + if (menu_is_empty(menu))
> + item_make(" %*c%s ----",
> + indent + 1, ' ', prompt);
> + else
> + item_make(" %*c%s --->",
> + indent + 1, ' ', prompt);
> + }
What about:
item_make(" %*c%s %s",
indent + 1, ' ', prompt,
menu_is_empty(menu) ? "----" : "--->" );
[--SNIP--]
> diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
> index dbf31ed..8b31180 100644
> --- a/scripts/kconfig/nconf.c
> +++ b/scripts/kconfig/nconf.c
[--SNIP--]
> @@ -757,11 +757,18 @@ static void build_conf(struct menu *menu)
> "%s%*c%s",
> menu->data ? "-->" : "++>",
> indent + 1, ' ', prompt);
> - } else
> - item_make(menu, 'm',
> - " %*c%s --->",
> - indent + 1,
> - ' ', prompt);
> + } else {
> + if (menu_is_empty(menu))
> + item_make(menu, 'm',
> + " %*c%s ----",
> + indent + 1,
> + ' ', prompt);
> + else
> + item_make(menu, 'm',
> + " %*c%s --->",
> + indent + 1,
> + ' ', prompt);
> + }
Ditto.
Otherwise, looks good to me.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic