Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e41ba05 authored by Ulf Magnusson's avatar Ulf Magnusson Committed by Masahiro Yamada
Browse files

kconfig: Document SYMBOL_OPTIONAL logic



Not obvious, especially if you don't already know how choices are
implemented.

No functional changes. Only comments added.

Signed-off-by: default avatarUlf Magnusson <ulfalizer@gmail.com>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent eea199b4
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -549,6 +549,15 @@ void menu_finalize(struct menu *parent)
		sym->flags |= SYMBOL_WARNED;
		sym->flags |= SYMBOL_WARNED;
	}
	}


	/*
	 * For non-optional choices, add a reverse dependency (corresponding to
	 * a select) of '<visibility> && m'. This prevents the user from
	 * setting the choice mode to 'n' when the choice is visible.
	 *
	 * This would also work for non-choice symbols, but only non-optional
	 * choices clear SYMBOL_OPTIONAL as of writing. Choices are implemented
	 * as a type of symbol.
	 */
	if (sym && !sym_is_optional(sym) && parent->prompt) {
	if (sym && !sym_is_optional(sym) && parent->prompt) {
		sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr,
		sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr,
				expr_alloc_and(parent->prompt->visible.expr,
				expr_alloc_and(parent->prompt->visible.expr,