linux-kernel.vger.kernel.org archive mirror
 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 02/16] kconfig: qconf: remove 'menu' variable
Date: Mon,  3 Aug 2020 01:17:07 +0900	[thread overview]
Message-ID: <20200802161721.921721-2-masahiroy@kernel.org> (raw)
In-Reply-To: <20200802161721.921721-1-masahiroy@kernel.org>

I think it is a bit confusing to use 'menu' to hold a QMenuBar pointer
because it looks like a QMenu pointer.

You do not need to use a local variable here. Use QMenuBar() directly.

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

 scripts/kconfig/qconf.cc | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 9513c0ba8d0c..0ef9a1da6475 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1381,7 +1381,6 @@ void ConfigSearchWindow::search(void)
 ConfigMainWindow::ConfigMainWindow(void)
 	: searchWindow(0)
 {
-	QMenuBar* menu;
 	bool ok = true;
 	QVariant x, y;
 	int width, height;
@@ -1432,7 +1431,6 @@ ConfigMainWindow::ConfigMainWindow(void)
 	setTabOrder(configList, helpText);
 	configList->setFocus();
 
-	menu = menuBar();
 	toolBar = new QToolBar("Tools", this);
 	addToolBar(toolBar);
 
@@ -1518,7 +1516,7 @@ ConfigMainWindow::ConfigMainWindow(void)
 	toolBar->addAction(fullViewAction);
 
 	// create file menu
-	QMenu *fileMenu = menu->addMenu("&File");
+	QMenu *fileMenu = menuBar()->addMenu("&File");
 	fileMenu->addAction(loadAction);
 	fileMenu->addAction(saveAction);
 	fileMenu->addAction(saveAsAction);
@@ -1526,12 +1524,13 @@ ConfigMainWindow::ConfigMainWindow(void)
 	fileMenu->addAction(quitAction);
 
 	// create edit menu
-	QMenu* editMenu = menu->addMenu("&Edit");
+	QMenu *editMenu = menuBar()->addMenu("&Edit");
 	editMenu->addAction(searchAction);
 
 	// create options menu
-	QMenu* optionMenu = menu->addMenu("&Option");
+	QMenu *optionMenu = menuBar()->addMenu("&Option");
 	optionMenu->addAction(showNameAction);
+
 	optionMenu->addAction(showRangeAction);
 	optionMenu->addAction(showDataAction);
 	optionMenu->addSeparator();
@@ -1540,8 +1539,8 @@ ConfigMainWindow::ConfigMainWindow(void)
 	optionMenu->addAction(showDebugAction);
 
 	// create help menu
-	menu->addSeparator();
-	QMenu* helpMenu = menu->addMenu("&Help");
+	menuBar()->addSeparator();
+	QMenu *helpMenu = menuBar()->addMenu("&Help");
 	helpMenu->addAction(showIntroAction);
 	helpMenu->addAction(showAboutAction);
 
-- 
2.25.1


  reply	other threads:[~2020-08-02 16:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 16:17 [PATCH 01/16] kconfig: qconf: rename 'config' to 'fileMenu' Masahiro Yamada
2020-08-02 16:17 ` Masahiro Yamada [this message]
2020-08-02 16:17 ` [PATCH 03/16] kconfig: qconf: remove toolBar from ConfigMainWindow members Masahiro Yamada
2020-08-02 16:17 ` [PATCH 04/16] kconfig: qconf: overload addToolBar() to create and insert toolbar Masahiro Yamada
2020-08-02 16:17 ` [PATCH 05/16] kconfig: qconf: remove unused ConfigList::listView() Masahiro Yamada
2020-08-02 16:17 ` [PATCH 06/16] kconfig: qconf: remove name from ConfigSearchWindow constructor Masahiro Yamada
2020-08-02 16:17 ` [PATCH 07/16] kconfig: qconf: omit parent to QHBoxLayout() Masahiro Yamada
2020-08-02 16:17 ` [PATCH 08/16] kconfig: qconf: remove unused argument from ConfigList::updateList() Masahiro Yamada
2020-08-02 16:17 ` [PATCH 09/16] kconfig: qconf: remove unused argument from ConfigView::updateList() Masahiro Yamada
2020-08-02 16:17 ` [PATCH 10/16] kconfig: qconf: remove 'parent' from ConfigList::updateMenuList() Masahiro Yamada
2020-08-02 16:17 ` [PATCH 11/16] kconfig: qconf: drop more localization code Masahiro Yamada
2020-08-02 16:17 ` [PATCH 12/16] kconfig: qconf: remove ConfigItem::pixmap/setPixmap Masahiro Yamada
2020-08-02 16:17 ` [PATCH 13/16] kconfig: qconf: remove ConfigList::addColumn/removeColumn Masahiro Yamada
2020-08-02 16:17 ` [PATCH 14/16] kconfig: qconf: remove ConfigItem::text/setText Masahiro Yamada
2020-08-02 16:17 ` [PATCH 15/16] kconfig: qconf: remove unused voidPix, menuInvPix Masahiro Yamada
2020-08-02 16:17 ` [PATCH 16/16] kconfig: qconf: refactor icon setups 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=20200802161721.921721-2-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 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).