Skip to content

Commit

Permalink
kconfig: qconf: navigate menus on hyperlinks
Browse files Browse the repository at this point in the history
Instead of just changing the helper window to show a
dependency, also navigate to it at the config and menu
widgets.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
mchehab authored and masahir0y committed Jul 1, 2020
1 parent cc1c08e commit 8a3b6e5
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions scripts/kconfig/qconf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,6 @@ void ConfigInfoView::clicked(const QUrl &url)
char *data = new char[count + 1];
struct symbol **result;
struct menu *m = NULL;
char type;

if (count < 1) {
qInfo() << "Clicked link is empty";
Expand All @@ -1243,7 +1242,6 @@ void ConfigInfoView::clicked(const QUrl &url)

memcpy(data, str.constData(), count);
data[count] = '\0';
type = data[0];

/* Seek for exact match */
data[0] = '^';
Expand All @@ -1256,15 +1254,8 @@ void ConfigInfoView::clicked(const QUrl &url)
}

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) {
if (prop->type != P_PROMPT && prop->type != P_MENU)
continue;
Expand All @@ -1273,16 +1264,13 @@ void ConfigInfoView::clicked(const QUrl &url)
}

if (!m) {
qInfo() << "Clicked menu is invalid:" << data;
free(result);
delete data;
return;
/* Symbol is not visible as a menu */
symbolInfo();
emit showDebugChanged(true);
} else {
emit menuSelected(m);
}

_menu = m;
menuInfo();

emit showDebugChanged(true);
free(result);
delete data;
}
Expand Down Expand Up @@ -1731,6 +1719,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
list->setSelected(item, true);
list->scrollToItem(item);
list->setFocus();
helpText->setInfo(menu);
}
}
}
Expand Down

0 comments on commit 8a3b6e5

Please sign in to comment.