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 v2 19/19] kconfig: qconf: move setOptionMode() to ConfigList from ConfigView
Date: Fri, 7 Aug 2020 18:19:09 +0900 [thread overview]
Message-ID: <20200807091909.2985787-19-masahiroy@kernel.org> (raw)
In-Reply-To: <20200807091909.2985787-1-masahiroy@kernel.org>
ConfigView::setOptionMode() only gets access to the 'list' member.
Move it to the more relevant ConfigList class.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Changes in v2:
- new patch
scripts/kconfig/qconf.cc | 46 ++++++++++++++++++++--------------------
scripts/kconfig/qconf.h | 9 ++++----
2 files changed, 27 insertions(+), 28 deletions(-)
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 8eacebfeb030..ee6da1a8c636 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -358,6 +358,18 @@ void ConfigList::reinit(void)
updateListAll();
}
+void ConfigList::setOptionMode(QAction *action)
+{
+ if (action == showNormalAction)
+ optMode = normalOpt;
+ else if (action == showAllAction)
+ optMode = allOpt;
+ else
+ optMode = promptOpt;
+
+ updateListAll();
+}
+
void ConfigList::saveSettings(void)
{
if (!objectName().isEmpty()) {
@@ -900,9 +912,9 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
}
ConfigView*ConfigView::viewList;
-QAction *ConfigView::showNormalAction;
-QAction *ConfigView::showAllAction;
-QAction *ConfigView::showPromptAction;
+QAction *ConfigList::showNormalAction;
+QAction *ConfigList::showAllAction;
+QAction *ConfigList::showPromptAction;
ConfigView::ConfigView(QWidget* parent, const char *name)
: Parent(parent)
@@ -933,18 +945,6 @@ ConfigView::~ConfigView(void)
}
}
-void ConfigView::setOptionMode(QAction *act)
-{
- if (act == showNormalAction)
- list->optMode = normalOpt;
- else if (act == showAllAction)
- list->optMode = allOpt;
- else
- list->optMode = promptOpt;
-
- list->updateListAll();
-}
-
void ConfigView::setShowName(bool b)
{
if (list->showName != b) {
@@ -1487,17 +1487,17 @@ ConfigMainWindow::ConfigMainWindow(void)
QActionGroup *optGroup = new QActionGroup(this);
optGroup->setExclusive(true);
- connect(optGroup, SIGNAL(triggered(QAction*)), configView,
+ connect(optGroup, SIGNAL(triggered(QAction*)), configList,
SLOT(setOptionMode(QAction *)));
- connect(optGroup, SIGNAL(triggered(QAction *)), menuView,
+ connect(optGroup, SIGNAL(triggered(QAction *)), menuList,
SLOT(setOptionMode(QAction *)));
- configView->showNormalAction = new QAction("Show Normal Options", optGroup);
- configView->showAllAction = new QAction("Show All Options", optGroup);
- configView->showPromptAction = new QAction("Show Prompt Options", optGroup);
- configView->showNormalAction->setCheckable(true);
- configView->showAllAction->setCheckable(true);
- configView->showPromptAction->setCheckable(true);
+ ConfigList::showNormalAction = new QAction("Show Normal Options", optGroup);
+ ConfigList::showNormalAction->setCheckable(true);
+ ConfigList::showAllAction = new QAction("Show All Options", optGroup);
+ ConfigList::showAllAction->setCheckable(true);
+ ConfigList::showPromptAction = new QAction("Show Prompt Options", optGroup);
+ ConfigList::showPromptAction->setCheckable(true);
QAction *showDebugAction = new QAction("Show Debug Info", this);
showDebugAction->setCheckable(true);
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index 460b858b0faa..461df6419f15 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -74,6 +74,8 @@ public slots:
void changeValue(ConfigItem* item);
void updateSelection(void);
void saveSettings(void);
+ void setOptionMode(QAction *action);
+
signals:
void menuChanged(struct menu *menu);
void menuSelected(struct menu *menu);
@@ -105,6 +107,8 @@ public slots:
QPalette disabledColorGroup;
QPalette inactivedColorGroup;
QMenu* headerPopup;
+
+ static QAction *showNormalAction, *showAllAction, *showPromptAction;
};
class ConfigItem : public QTreeWidgetItem {
@@ -196,7 +200,6 @@ public slots:
void setShowName(bool);
void setShowRange(bool);
void setShowData(bool);
- void setOptionMode(QAction *);
signals:
void showNameChanged(bool);
void showRangeChanged(bool);
@@ -207,10 +210,6 @@ public slots:
static ConfigView* viewList;
ConfigView* nextView;
-
- static QAction *showNormalAction;
- static QAction *showAllAction;
- static QAction *showPromptAction;
};
class ConfigInfoView : public QTextBrowser {
--
2.25.1
prev parent reply other threads:[~2020-08-07 9:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-07 9:18 [PATCH v2 01/19] kconfig: qconf: remove ->addSeparator() to menuBar Masahiro Yamada
2020-08-07 9:18 ` [PATCH v2 02/19] kconfig: qconf: do not use 'menu' variable for (QMenuBar *) Masahiro Yamada
2020-08-07 9:18 ` [PATCH v2 03/19] kconfig: qconf: use 'menu' variable for (QMenu *) Masahiro Yamada
2020-08-07 9:18 ` [PATCH v2 04/19] kconfig: qconf: remove toolBar from ConfigMainWindow members Masahiro Yamada
2020-08-07 9:18 ` [PATCH v2 05/19] kconfig: qconf: overload addToolBar() to create and insert toolbar Masahiro Yamada
2020-08-07 9:18 ` [PATCH v2 06/19] kconfig: qconf: remove unused ConfigList::listView() Masahiro Yamada
2020-08-07 9:18 ` [PATCH v2 07/19] kconfig: qconf: remove name from ConfigSearchWindow constructor Masahiro Yamada
2020-08-07 9:18 ` [PATCH v2 08/19] kconfig: qconf: omit parent to QHBoxLayout() Masahiro Yamada
2020-08-07 9:18 ` [PATCH v2 09/19] kconfig: qconf: remove unused argument from ConfigList::updateList() Masahiro Yamada
2020-08-07 9:19 ` [PATCH v2 10/19] kconfig: qconf: remove unused argument from ConfigView::updateList() Masahiro Yamada
2020-08-07 9:19 ` [PATCH v2 11/19] kconfig: qconf: remove 'parent' from ConfigList::updateMenuList() Masahiro Yamada
2020-08-07 9:19 ` [PATCH v2 12/19] kconfig: qconf: drop more localization code Masahiro Yamada
2020-08-07 9:19 ` [PATCH v2 13/19] kconfig: qconf: remove ConfigItem::pixmap/setPixmap Masahiro Yamada
2020-08-07 9:19 ` [PATCH v2 14/19] kconfig: qconf: remove ConfigList::addColumn/removeColumn Masahiro Yamada
2020-08-07 9:19 ` [PATCH v2 15/19] kconfig: qconf: remove ConfigItem::text/setText Masahiro Yamada
2020-08-07 9:19 ` [PATCH v2 16/19] kconfig: qconf: remove unused voidPix, menuInvPix Masahiro Yamada
2020-08-07 9:19 ` [PATCH v2 17/19] kconfig: qconf: refactor icon setups Masahiro Yamada
2020-08-07 9:19 ` [PATCH v2 18/19] kconfig: qconf: do not limit the pop-up menu to the first row Masahiro Yamada
2020-08-07 9:19 ` Masahiro Yamada [this message]
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=20200807091909.2985787-19-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).