summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2019-04-28 03:48:13 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2019-04-28 04:15:03 +0200
commit4b387e0bf0a2d206ef8d3ce8768a0166f66d898a (patch)
tree332e849dae8c1fd1bedcbcd3cb15f2e8b106187e
parent74cb7c397db8b5f5178370541535a393ed964621 (diff)
menuconfig: Fix display issue for unsatisfied-deps selected symbol with children
A symbol with unsatisfied direct dependencies can end up with visible children in an implicit submenu if it is selected (though that generates a warning), so the optimization in _shown_nodes() isn't safe, and causes the child nodes to not be shown outside show-all mode. Just remove the optimization. Trying things out some more, everything's plenty fast enough anyway. Checking the direct dependencies of the parent instead would be safe.
-rwxr-xr-xmenuconfig.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/menuconfig.py b/menuconfig.py
index a3a40e5..bc7e4fd 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -1463,10 +1463,6 @@ def _shown_nodes(menu):
res = []
while node:
- # This code is minorly performance-sensitive. Make it too slow
- # (e.g., by always recursing the entire tree), and going in and out
- # of menus no longer feels instant.
-
if _visible(node) or _show_all:
res.append(node)
if node.list and not node.is_menuconfig:
@@ -1475,14 +1471,11 @@ def _shown_nodes(menu):
# menus and choices as well as 'menuconfig' symbols.
res += rec(node.list)
- elif node.list and isinstance(node.item, Symbol) and \
- expr_value(node.dep):
+ elif node.list and isinstance(node.item, Symbol):
# Show invisible symbols if they have visible children. This
# can happen for an m/y-valued symbol with an optional prompt
- # ('prompt "foo" is COND') that is currently disabled. The
- # expr_value(node.dep) check safely prunes the search: A node
- # with unsatisfied direct dependencies can never have visible
- # children.
+ # ('prompt "foo" is COND') that is currently disabled. Note
+ # that it applies to both 'config' and 'menuconfig' symbols.
shown_children = rec(node.list)
if shown_children:
res.append(node)