linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: Randy Dunlap <rdunlap@infradead.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 08/11] kconfig: qconf: move setShowName/Range() to ConfigList from ConfigView
Date: Sat, 29 Aug 2020 17:14:14 +0900	[thread overview]
Message-ID: <20200829081417.725978-8-masahiroy@kernel.org> (raw)
In-Reply-To: <20200829081417.725978-1-masahiroy@kernel.org>

ConfigView::setShowName/Range() only get access to the 'list' member.

Move them to the more relevant ConfigList class.

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

 scripts/kconfig/qconf.cc | 53 +++++++++++++++++++++-------------------
 scripts/kconfig/qconf.h  | 12 +++------
 2 files changed, 32 insertions(+), 33 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 5c42c1ae9408..db7eba95cdf8 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -920,8 +920,8 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
 		action = new QAction("Show Name", this);
 		action->setCheckable(true);
 		connect(action, SIGNAL(toggled(bool)),
-			parent(), SLOT(setShowName(bool)));
-		connect(parent(), SIGNAL(showNameChanged(bool)),
+			SLOT(setShowName(bool)));
+		connect(this, SIGNAL(showNameChanged(bool)),
 			action, SLOT(setChecked(bool)));
 		action->setChecked(showName);
 		headerPopup->addAction(action);
@@ -929,8 +929,8 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
 		action = new QAction("Show Range", this);
 		action->setCheckable(true);
 		connect(action, SIGNAL(toggled(bool)),
-			parent(), SLOT(setShowRange(bool)));
-		connect(parent(), SIGNAL(showRangeChanged(bool)),
+			SLOT(setShowRange(bool)));
+		connect(this, SIGNAL(showRangeChanged(bool)),
 			action, SLOT(setChecked(bool)));
 		action->setChecked(showRange);
 		headerPopup->addAction(action);
@@ -940,6 +940,26 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
 	e->accept();
 }
 
+void ConfigList::setShowName(bool on)
+{
+	if (showName == on)
+		return;
+
+	showName = on;
+	reinit();
+	emit showNameChanged(on);
+}
+
+void ConfigList::setShowRange(bool on)
+{
+	if (showRange == on)
+		return;
+
+	showRange = on;
+	reinit();
+	emit showRangeChanged(on);
+}
+
 QList<ConfigList *> ConfigList::allLists;
 QAction *ConfigList::showNormalAction;
 QAction *ConfigList::showAllAction;
@@ -956,24 +976,6 @@ ConfigView::ConfigView(QWidget* parent, const char *name)
 	verticalLayout->addWidget(list);
 }
 
-void ConfigView::setShowName(bool b)
-{
-	if (list->showName != b) {
-		list->showName = b;
-		list->reinit();
-		emit showNameChanged(b);
-	}
-}
-
-void ConfigView::setShowRange(bool b)
-{
-	if (list->showRange != b) {
-		list->showRange = b;
-		list->reinit();
-		emit showRangeChanged(b);
-	}
-}
-
 void ConfigList::setAllOpen(bool open)
 {
 	QTreeWidgetItemIterator it(this);
@@ -1460,11 +1462,12 @@ ConfigMainWindow::ConfigMainWindow(void)
 
 	QAction *showNameAction = new QAction("Show Name", this);
 	  showNameAction->setCheckable(true);
-	  connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool)));
-	  showNameAction->setChecked(configView->showName());
+	connect(showNameAction, SIGNAL(toggled(bool)), configList, SLOT(setShowName(bool)));
+	showNameAction->setChecked(configList->showName);
+
 	QAction *showRangeAction = new QAction("Show Range", this);
 	  showRangeAction->setCheckable(true);
-	  connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
+	connect(showRangeAction, SIGNAL(toggled(bool)), configList, SLOT(setShowRange(bool)));
 
 	QActionGroup *optGroup = new QActionGroup(this);
 	optGroup->setExclusive(true);
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index a3ee91565d49..843725584bfa 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -76,6 +76,8 @@ public slots:
 	void updateSelection(void);
 	void saveSettings(void);
 	void setOptionMode(QAction *action);
+	void setShowName(bool on);
+	void setShowRange(bool on);
 
 signals:
 	void menuChanged(struct menu *menu);
@@ -83,6 +85,8 @@ public slots:
 	void itemSelected(struct menu *menu);
 	void parentSelected(void);
 	void gotFocus(struct menu *);
+	void showNameChanged(bool on);
+	void showRangeChanged(bool on);
 
 public:
 	void updateListAll(void)
@@ -192,14 +196,6 @@ class ConfigView : public QWidget {
 public:
 	ConfigView(QWidget* parent, const char *name = 0);
 
-	bool showName(void) const { return list->showName; }
-	bool showRange(void) const { return list->showRange; }
-public slots:
-	void setShowName(bool);
-	void setShowRange(bool);
-signals:
-	void showNameChanged(bool);
-	void showRangeChanged(bool);
 public:
 	ConfigList* list;
 };
-- 
2.25.1


  parent reply	other threads:[~2020-08-29  8:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-29  8:14 [PATCH 01/11] kconfig: qconf: reformat the intro message Masahiro Yamada
2020-08-29  8:14 ` [PATCH 02/11] kconfig: qconf: update the intro message to match to the current code Masahiro Yamada
2020-08-30  4:58   ` Randy Dunlap
2020-08-29  8:14 ` [PATCH 03/11] kconfig: qconf: remove unused ConfigItem::okRename() Masahiro Yamada
2020-08-29  8:14 ` [PATCH 04/11] kconfig: qconf: move ConfigView::updateList(All) to ConfigList class Masahiro Yamada
2020-08-29  8:14 ` [PATCH 05/11] kconfig: qconf: show data column all the time Masahiro Yamada
2020-08-30  4:54   ` Randy Dunlap
2020-08-30  9:59     ` Masahiro Yamada
2020-08-29  8:14 ` [PATCH 06/11] kconfig: qconf: allow to edit "int", "hex", "string" menus in-place Masahiro Yamada
2020-08-30  4:54   ` Randy Dunlap
2020-08-30 10:01     ` Masahiro Yamada
2020-08-29  8:14 ` [PATCH 07/11] kconfig: qconf: remove ConfigLineEdit class Masahiro Yamada
2020-08-29  8:14 ` Masahiro Yamada [this message]
2020-08-29  8:14 ` [PATCH 09/11] kconfig: qconf: remove ConfigView class Masahiro Yamada
2020-08-29  8:14 ` [PATCH 10/11] kconfig: qconf: remove Y, M, N columns Masahiro Yamada
2020-08-29  8:14 ` [PATCH 11/11] kconfig: qconf: create QApplication after option checks Masahiro Yamada
2020-08-30  4:58   ` Randy Dunlap
2020-08-30  4:59 ` [PATCH 01/11] kconfig: qconf: reformat the intro message Randy Dunlap

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=20200829081417.725978-8-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rdunlap@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).