Commit d4b1cea7 authored by Masahiro Yamada's avatar Masahiro Yamada

kconfig: qconf: do not use 'menu' variable for (QMenuBar *)

I think it is a bit confusing to use 'menu' to hold a QMenuBar pointer.
I want to use 'menu' for a QMenu pointer.

You do not need to use a local variable here. Use menuBar() directly.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 614bf0a8
...@@ -1382,7 +1382,6 @@ void ConfigSearchWindow::search(void) ...@@ -1382,7 +1382,6 @@ void ConfigSearchWindow::search(void)
ConfigMainWindow::ConfigMainWindow(void) ConfigMainWindow::ConfigMainWindow(void)
: searchWindow(0) : searchWindow(0)
{ {
QMenuBar* menu;
bool ok = true; bool ok = true;
QVariant x, y; QVariant x, y;
int width, height; int width, height;
...@@ -1433,7 +1432,6 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1433,7 +1432,6 @@ ConfigMainWindow::ConfigMainWindow(void)
setTabOrder(configList, helpText); setTabOrder(configList, helpText);
configList->setFocus(); configList->setFocus();
menu = menuBar();
toolBar = new QToolBar("Tools", this); toolBar = new QToolBar("Tools", this);
addToolBar(toolBar); addToolBar(toolBar);
...@@ -1519,7 +1517,7 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1519,7 +1517,7 @@ ConfigMainWindow::ConfigMainWindow(void)
toolBar->addAction(fullViewAction); toolBar->addAction(fullViewAction);
// create config menu // create config menu
QMenu* config = menu->addMenu("&File"); QMenu* config = menuBar()->addMenu("&File");
config->addAction(loadAction); config->addAction(loadAction);
config->addAction(saveAction); config->addAction(saveAction);
config->addAction(saveAsAction); config->addAction(saveAsAction);
...@@ -1527,12 +1525,13 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1527,12 +1525,13 @@ ConfigMainWindow::ConfigMainWindow(void)
config->addAction(quitAction); config->addAction(quitAction);
// create edit menu // create edit menu
QMenu* editMenu = menu->addMenu("&Edit"); QMenu* editMenu = menuBar()->addMenu("&Edit");
editMenu->addAction(searchAction); editMenu->addAction(searchAction);
// create options menu // create options menu
QMenu* optionMenu = menu->addMenu("&Option"); QMenu* optionMenu = menuBar()->addMenu("&Option");
optionMenu->addAction(showNameAction); optionMenu->addAction(showNameAction);
optionMenu->addAction(showRangeAction); optionMenu->addAction(showRangeAction);
optionMenu->addAction(showDataAction); optionMenu->addAction(showDataAction);
optionMenu->addSeparator(); optionMenu->addSeparator();
...@@ -1541,7 +1540,7 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1541,7 +1540,7 @@ ConfigMainWindow::ConfigMainWindow(void)
optionMenu->addAction(showDebugAction); optionMenu->addAction(showDebugAction);
// create help menu // create help menu
QMenu* helpMenu = menu->addMenu("&Help"); QMenu* helpMenu = menuBar()->addMenu("&Help");
helpMenu->addAction(showIntroAction); helpMenu->addAction(showIntroAction);
helpMenu->addAction(showAboutAction); helpMenu->addAction(showAboutAction);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment