Commit 8a3b6e56 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Masahiro Yamada

kconfig: qconf: navigate menus on hyperlinks

Instead of just changing the helper window to show a
dependency, also navigate to it at the config and menu
widgets.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent cc1c08ed
...@@ -1233,7 +1233,6 @@ void ConfigInfoView::clicked(const QUrl &url) ...@@ -1233,7 +1233,6 @@ void ConfigInfoView::clicked(const QUrl &url)
char *data = new char[count + 1]; char *data = new char[count + 1];
struct symbol **result; struct symbol **result;
struct menu *m = NULL; struct menu *m = NULL;
char type;
if (count < 1) { if (count < 1) {
qInfo() << "Clicked link is empty"; qInfo() << "Clicked link is empty";
...@@ -1243,7 +1242,6 @@ void ConfigInfoView::clicked(const QUrl &url) ...@@ -1243,7 +1242,6 @@ void ConfigInfoView::clicked(const QUrl &url)
memcpy(data, str.constData(), count); memcpy(data, str.constData(), count);
data[count] = '\0'; data[count] = '\0';
type = data[0];
/* Seek for exact match */ /* Seek for exact match */
data[0] = '^'; data[0] = '^';
...@@ -1256,15 +1254,8 @@ void ConfigInfoView::clicked(const QUrl &url) ...@@ -1256,15 +1254,8 @@ void ConfigInfoView::clicked(const QUrl &url)
} }
sym = *result; sym = *result;
if (type == 's') {
symbolInfo();
emit showDebugChanged(true);
free(result);
delete data;
return;
}
/* URL is a menu */ /* Seek for the menu which holds the symbol */
for (struct property *prop = sym->prop; prop; prop = prop->next) { for (struct property *prop = sym->prop; prop; prop = prop->next) {
if (prop->type != P_PROMPT && prop->type != P_MENU) if (prop->type != P_PROMPT && prop->type != P_MENU)
continue; continue;
...@@ -1273,16 +1264,13 @@ void ConfigInfoView::clicked(const QUrl &url) ...@@ -1273,16 +1264,13 @@ void ConfigInfoView::clicked(const QUrl &url)
} }
if (!m) { if (!m) {
qInfo() << "Clicked menu is invalid:" << data; /* Symbol is not visible as a menu */
free(result); symbolInfo();
delete data; emit showDebugChanged(true);
return; } else {
emit menuSelected(m);
} }
_menu = m;
menuInfo();
emit showDebugChanged(true);
free(result); free(result);
delete data; delete data;
} }
...@@ -1731,6 +1719,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu) ...@@ -1731,6 +1719,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
list->setSelected(item, true); list->setSelected(item, true);
list->scrollToItem(item); list->scrollToItem(item);
list->setFocus(); list->setFocus();
helpText->setInfo(menu);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment