Skip to content

Commit c699eaa

Browse files
mchehabmasahir0y
authored andcommitted
kconfig: qconf: make search fully work again on split mode
When the search dialog box finds symbols/menus that match the search criteria, it presents all results at the window. Clicking on a search result should make qconf to navigate to the selected item. This works on singleMode and on fullMode, but on splitMode, the navigation is broken. This was partially caused by an incomplete Qt5 conversion and by the followup patches that restored the original behavior. When qconf is on split mode, it has to update both the config and the menu views. Right now, such logic is broken, as it is not seeking using the right structures. On qconf, the screen is split into 3 parts: +------------+-------+ | | | | Config | Menu | | | | +------------+-------+ | | | ConfigInfo | | | +--------------------+ On singleMode and on fullMode, the menuView is hidden, and search updates only the configList (which controls the ConfigView). On SplitMode, the search logic should detect if the variable is a leaf or not. If it is a leaf, it should be presented at the menuView, and both configList and menuList should be updated. Otherwise, just the configList should be updated. Link: https://lore.kernel.org/lkml/[email protected]/ Reported-by: Maxim Levitsky <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent cf81dfa commit c699eaa

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

scripts/kconfig/qconf.cc

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,22 +1636,33 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
16361636
return;
16371637
list->setRootMenu(parent);
16381638
break;
1639-
case symbolMode:
1639+
case menuMode:
16401640
if (menu->flags & MENU_ROOT) {
1641-
configList->setRootMenu(menu);
1641+
menuList->setRootMenu(menu);
16421642
configList->clearSelection();
1643-
list = menuList;
1644-
} else {
16451643
list = configList;
1644+
} else {
16461645
parent = menu_get_parent_menu(menu->parent);
16471646
if (!parent)
16481647
return;
1649-
item = menuList->findConfigItem(parent);
1648+
1649+
/* Clear an already-selected item */
1650+
if (!configList->selectedItems().isEmpty()) {
1651+
item = (ConfigItem*)configList->selectedItems().first();
1652+
if (item)
1653+
item->setSelected(false);
1654+
}
1655+
1656+
/* Select the config view */
1657+
item = configList->findConfigItem(parent);
16501658
if (item) {
16511659
item->setSelected(true);
1652-
menuList->scrollToItem(item);
1660+
configList->scrollToItem(item);
16531661
}
1654-
list->setRootMenu(parent);
1662+
1663+
menuList->setRootMenu(parent);
1664+
menuList->clearSelection();
1665+
list = menuList;
16551666
}
16561667
break;
16571668
case fullMode:

0 commit comments

Comments
 (0)