History

kconfig: qconf: move setOptionMode() to ConfigList from ConfigView

ConfigView::setOptionMode() only gets access to the 'list' member. Move it to the more relevant ConfigList class.

Masahiro Yamada committed 6 years ago

Commit d4bbe8a1 parent fa8de0a2 files · +27 −28Browse files

Unified · Split

2 files
  1. scripts/kconfig/qconf.cc +23 −23
  2. scripts/kconfig/qconf.h +4 −5
scripts/kconfig/qconf.cc+23−23
@@ -358,6 +358,18 @@ void ConfigList::reinit(void) · 357 unmodified lines
358358 updateListAll();
359359 }
360360
361+void ConfigList::setOptionMode(QAction *action)
362+{
363+ if (action == showNormalAction)
364+ optMode = normalOpt;
365+ else if (action == showAllAction)
366+ optMode = allOpt;
367+ else
368+ optMode = promptOpt;
369+
370+ updateListAll();
371+}
372+
361373 void ConfigList::saveSettings(void)
362374 {
363375 if (!objectName().isEmpty()) {
@@ -901,9 +913,9 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) · 537 unmodified lines
901913 }
902914
903915 ConfigView*ConfigView::viewList;
904−QAction *ConfigView::showNormalAction;
905−QAction *ConfigView::showAllAction;
906−QAction *ConfigView::showPromptAction;
916+QAction *ConfigList::showNormalAction;
917+QAction *ConfigList::showAllAction;
918+QAction *ConfigList::showPromptAction;
907919
908920 ConfigView::ConfigView(QWidget* parent, const char *name)
909921 : Parent(parent)
@@ -934,18 +946,6 @@ ConfigView::~ConfigView(void) · 24 unmodified lines
934946 }
935947 }
936948
937−void ConfigView::setOptionMode(QAction *act)
938−{
939− if (act == showNormalAction)
940− list->optMode = normalOpt;
941− else if (act == showAllAction)
942− list->optMode = allOpt;
943− else
944− list->optMode = promptOpt;
945−
946− list->updateListAll();
947−}
948−
949949 void ConfigView::setShowName(bool b)
950950 {
951951 if (list->showName != b) {
@@ -1488,17 +1488,17 @@ ConfigMainWindow::ConfigMainWindow(void) · 536 unmodified lines
14881488
14891489 QActionGroup *optGroup = new QActionGroup(this);
14901490 optGroup->setExclusive(true);
1491− connect(optGroup, SIGNAL(triggered(QAction*)), configView,
1491+ connect(optGroup, SIGNAL(triggered(QAction*)), configList,
14921492 SLOT(setOptionMode(QAction *)));
1493− connect(optGroup, SIGNAL(triggered(QAction *)), menuView,
1493+ connect(optGroup, SIGNAL(triggered(QAction *)), menuList,
14941494 SLOT(setOptionMode(QAction *)));
14951495
1496− configView->showNormalAction = new QAction("Show Normal Options", optGroup);
1497− configView->showAllAction = new QAction("Show All Options", optGroup);
1498− configView->showPromptAction = new QAction("Show Prompt Options", optGroup);
1499− configView->showNormalAction->setCheckable(true);
1500− configView->showAllAction->setCheckable(true);
1501− configView->showPromptAction->setCheckable(true);
1496+ ConfigList::showNormalAction = new QAction("Show Normal Options", optGroup);
1497+ ConfigList::showNormalAction->setCheckable(true);
1498+ ConfigList::showAllAction = new QAction("Show All Options", optGroup);
1499+ ConfigList::showAllAction->setCheckable(true);
1500+ ConfigList::showPromptAction = new QAction("Show Prompt Options", optGroup);
1501+ ConfigList::showPromptAction->setCheckable(true);
15021502
15031503 QAction *showDebugAction = new QAction("Show Debug Info", this);
15041504 showDebugAction->setCheckable(true);
scripts/kconfig/qconf.h+4−5
@@ -74,6 +74,8 @@ public slots: · 73 unmodified lines
7474 void changeValue(ConfigItem* item);
7575 void updateSelection(void);
7676 void saveSettings(void);
77+ void setOptionMode(QAction *action);
78+
7779 signals:
7880 void menuChanged(struct menu *menu);
7981 void menuSelected(struct menu *menu);
@@ -105,6 +107,8 @@ public: · 25 unmodified lines
105107 QPalette disabledColorGroup;
106108 QPalette inactivedColorGroup;
107109 QMenu* headerPopup;
110+
111+ static QAction *showNormalAction, *showAllAction, *showPromptAction;
108112 };
109113
110114 class ConfigItem : public QTreeWidgetItem {
@@ -196,7 +200,6 @@ public slots: · 85 unmodified lines
196200 void setShowName(bool);
197201 void setShowRange(bool);
198202 void setShowData(bool);
199− void setOptionMode(QAction *);
200203 signals:
201204 void showNameChanged(bool);
202205 void showRangeChanged(bool);
@@ -207,10 +210,6 @@ public: · 4 unmodified lines
207210
208211 static ConfigView* viewList;
209212 ConfigView* nextView;
210−
211− static QAction *showNormalAction;
212− static QAction *showAllAction;
213− static QAction *showPromptAction;
214213 };
215214
216215 class ConfigInfoView : public QTextBrowser {