summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/qconf.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-06-30 08:26:38 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2020-07-01 16:59:30 +0200
commitb06c3ec3bd184e8bbd3e37d53a3d27c4ab9ccd09 (patch)
tree45c8dd4c51def6ef7293a043fa45b4448d3fa4cf /scripts/kconfig/qconf.h
parentkconfig: qconf: make debug links work again (diff)
downloadlinux-b06c3ec3bd184e8bbd3e37d53a3d27c4ab9ccd09.tar.xz
linux-b06c3ec3bd184e8bbd3e37d53a3d27c4ab9ccd09.zip
kconfig: qconf: re-implement setSelected()
The default implementation for setSelected() at QTreeWidgetItem allows multiple items to be selected. Well, this should never be possible for the configItem lists. So, implement a function that will automatically clean any previous selection. This simplifies the logic somewhat, while making the selection logic to be applied atomically, avoiding future issues on that. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/kconfig/qconf.h')
-rw-r--r--scripts/kconfig/qconf.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index a193137f2314..fb9e9729266f 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -45,11 +45,17 @@ class ConfigList : public QTreeWidget {
public:
ConfigList(ConfigView* p, const char *name = 0);
void reinit(void);
+ ConfigItem* findConfigItem(struct menu *);
ConfigView* parent(void) const
{
return (ConfigView*)Parent::parent();
}
- ConfigItem* findConfigItem(struct menu *);
+ void setSelected(QTreeWidgetItem *item, bool enable) {
+ for (int i = 0; i < selectedItems().size(); i++)
+ selectedItems().at(i)->setSelected(false);
+
+ item->setSelected(enable);
+ }
protected:
void keyPressEvent(QKeyEvent *e);