summaryrefslogtreecommitdiff
path: root/scripts/kconfig/qconf.cc
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-08-29 17:14:14 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2020-09-25 00:37:13 +0900
commit7930dd91a01fe9c0ff7664c7f0bdf38fba9047bc (patch)
treee96d3dca5c4acd7a2b74aeca010cebf2aff32add /scripts/kconfig/qconf.cc
parentf3eea294e93facc78ffcf3881f88ea02732283a9 (diff)
kconfig: qconf: move setShowName/Range() to ConfigList from ConfigView
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>
Diffstat (limited to 'scripts/kconfig/qconf.cc')
-rw-r--r--scripts/kconfig/qconf.cc53
1 files changed, 28 insertions, 25 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 461681aa5b19..5f3e5e145a99 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);
@@ -1465,11 +1467,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);