All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <masahiroy@kernel.org>, linux-kernel@vger.kernel.org
Subject: [PATCH 07/13] kconfig: qconf: remove ConfigItem::visible member
Date: Thu, 24 Oct 2024 03:17:57 +0900	[thread overview]
Message-ID: <20241023181823.138524-7-masahiroy@kernel.org> (raw)
In-Reply-To: <20241023181823.138524-1-masahiroy@kernel.org>

The " (NEW)" string should be displayed regardless of the visibility
of the associated menu.

The ConfigItem::visible member is not used for any other purpose.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/qconf.cc | 28 +++++++++++-----------------
 scripts/kconfig/qconf.h  | 15 +++++++--------
 2 files changed, 18 insertions(+), 25 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 7c844c4a119e..5b1237bf085a 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -175,17 +175,16 @@ void ConfigItem::updateMenu(void)
 		setText(dataColIdx, sym_get_string_value(sym));
 		break;
 	}
-	if (!sym_has_value(sym) && visible)
+	if (!sym_has_value(sym))
 		prompt += " (NEW)";
 set_prompt:
 	setText(promptColIdx, prompt);
 }
 
-void ConfigItem::testUpdateMenu(bool v)
+void ConfigItem::testUpdateMenu(void)
 {
 	ConfigItem* i;
 
-	visible = v;
 	if (!menu)
 		return;
 
@@ -429,7 +428,7 @@ void ConfigList::updateList()
 			item = (ConfigItem*)(*it);
 			if (!item->menu)
 				continue;
-			item->testUpdateMenu(menu_is_visible(item->menu));
+			item->testUpdateMenu();
 
 			++it;
 		}
@@ -439,16 +438,16 @@ void ConfigList::updateList()
 	if (rootEntry != &rootmenu && mode == singleMode) {
 		item = (ConfigItem *)topLevelItem(0);
 		if (!item)
-			item = new ConfigItem(this, 0, true);
+			item = new ConfigItem(this, 0);
 		last = item;
 	}
 	if ((mode == singleMode || (mode == symbolMode && !(rootEntry->flags & MENU_ROOT))) &&
 	    rootEntry->sym && rootEntry->prompt) {
 		item = last ? last->nextSibling() : nullptr;
 		if (!item)
-			item = new ConfigItem(this, last, rootEntry, true);
+			item = new ConfigItem(this, last, rootEntry);
 		else
-			item->testUpdateMenu(true);
+			item->testUpdateMenu();
 
 		updateMenuList(item, rootEntry);
 		update();
@@ -597,7 +596,6 @@ void ConfigList::updateMenuList(ConfigItem *parent, struct menu* menu)
 	struct menu* child;
 	ConfigItem* item;
 	ConfigItem* last;
-	bool visible;
 	enum prop_type type;
 
 	if (!menu) {
@@ -629,14 +627,13 @@ void ConfigList::updateMenuList(ConfigItem *parent, struct menu* menu)
 			break;
 		}
 
-		visible = menu_is_visible(child);
 		if (!menuSkip(child)) {
 			if (!child->sym && !child->list && !child->prompt)
 				continue;
 			if (!item || item->menu != child)
-				item = new ConfigItem(parent, last, child, visible);
+				item = new ConfigItem(parent, last, child);
 			else
-				item->testUpdateMenu(visible);
+				item->testUpdateMenu();
 
 			if (mode == fullMode || mode == menuMode || type != P_MENU)
 				updateMenuList(item, child);
@@ -662,7 +659,6 @@ void ConfigList::updateMenuList(struct menu *menu)
 	struct menu* child;
 	ConfigItem* item;
 	ConfigItem* last;
-	bool visible;
 	enum prop_type type;
 
 	if (!menu) {
@@ -694,14 +690,13 @@ void ConfigList::updateMenuList(struct menu *menu)
 			break;
 		}
 
-		visible = menu_is_visible(child);
 		if (!menuSkip(child)) {
 			if (!child->sym && !child->list && !child->prompt)
 				continue;
 			if (!item || item->menu != child)
-				item = new ConfigItem(this, last, child, visible);
+				item = new ConfigItem(this, last, child);
 			else
-				item->testUpdateMenu(visible);
+				item->testUpdateMenu();
 
 			if (mode == fullMode || mode == menuMode || type != P_MENU)
 				updateMenuList(item, child);
@@ -1274,8 +1269,7 @@ void ConfigSearchWindow::search(void)
 		return;
 	for (p = result; *p; p++) {
 		for_all_prompts((*p), prop)
-			lastItem = new ConfigItem(list, lastItem, prop->menu,
-						  menu_is_visible(prop->menu));
+			lastItem = new ConfigItem(list, lastItem, prop->menu);
 	}
 }
 
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index 0b62fb26821a..62ab3286d04f 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -114,25 +114,25 @@ public slots:
 class ConfigItem : public QTreeWidgetItem {
 	typedef class QTreeWidgetItem Parent;
 public:
-	ConfigItem(ConfigList *parent, ConfigItem *after, struct menu *m, bool v)
-	: Parent(parent, after), nextItem(0), menu(m), visible(v), goParent(false)
+	ConfigItem(ConfigList *parent, ConfigItem *after, struct menu *m)
+	: Parent(parent, after), nextItem(0), menu(m), goParent(false)
 	{
 		init();
 	}
-	ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v)
-	: Parent(parent, after), nextItem(0), menu(m), visible(v), goParent(false)
+	ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m)
+	: Parent(parent, after), nextItem(0), menu(m), goParent(false)
 	{
 		init();
 	}
-	ConfigItem(ConfigList *parent, ConfigItem *after, bool v)
-	: Parent(parent, after), nextItem(0), menu(0), visible(v), goParent(true)
+	ConfigItem(ConfigList *parent, ConfigItem *after)
+	: Parent(parent, after), nextItem(0), menu(0), goParent(true)
 	{
 		init();
 	}
 	~ConfigItem(void);
 	void init(void);
 	void updateMenu(void);
-	void testUpdateMenu(bool v);
+	void testUpdateMenu(void);
 	ConfigList* listView() const
 	{
 		return (ConfigList*)Parent::treeWidget();
@@ -159,7 +159,6 @@ class ConfigItem : public QTreeWidgetItem {
 
 	ConfigItem* nextItem;
 	struct menu *menu;
-	bool visible;
 	bool goParent;
 
 	static QIcon symbolYesIcon, symbolModIcon, symbolNoIcon;
-- 
2.43.0


  parent reply	other threads:[~2024-10-23 18:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23 18:17 [PATCH 01/13] kconfig: qconf: remove mouse{Press,Move}Event() functions Masahiro Yamada
2024-10-23 18:17 ` [PATCH 02/13] kconfig: qconf: remove redundant type check for choice members Masahiro Yamada
2024-10-23 18:17 ` [PATCH 03/13] kconfig: qconf: remove unnecessary setRootIsDecorated() call Masahiro Yamada
2024-10-23 18:17 ` [PATCH 04/13] kconfig: qconf: remove unnecessary lastWindowClosed() signal connection Masahiro Yamada
2024-10-23 18:17 ` [PATCH 05/13] kconfig: qconf: convert the last old connection syntax to Qt5 style Masahiro Yamada
2024-10-23 18:17 ` [PATCH 06/13] kconfig: qconf: do not show goParent button in split view Masahiro Yamada
2024-10-23 18:17 ` Masahiro Yamada [this message]
2024-10-23 18:17 ` [PATCH 08/13] kconfig: qconf: avoid unnecessary parentSelected() when ESC is pressed Masahiro Yamada
2024-10-23 18:17 ` [PATCH 09/13] kconfig: qconf: remove redundant check in goBack() Masahiro Yamada
2024-10-23 18:18 ` [PATCH 10/13] kconfig: qconf: remove non-functional href="m..." tag Masahiro Yamada
2024-10-23 18:18 ` [PATCH 11/13] kconfig: add sym_get_prompt_menu() helper function Masahiro Yamada
2024-10-23 18:18 ` [PATCH 12/13] kconfig: qconf: refactor ConfigInfoView::clicked() Masahiro Yamada
2024-10-23 18:18 ` [PATCH 13/13] kconfig: qconf: remove unnecessary mode check in ConfigItem::updateMenu() Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241023181823.138524-7-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.