Skip to content

Commit 8a3b6e5

Browse files
mchehabmasahir0y
authored andcommitted
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: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent cc1c08e commit 8a3b6e5

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

scripts/kconfig/qconf.cc

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,6 @@ void ConfigInfoView::clicked(const QUrl &url)
12331233
char *data = new char[count + 1];
12341234
struct symbol **result;
12351235
struct menu *m = NULL;
1236-
char type;
12371236

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

12441243
memcpy(data, str.constData(), count);
12451244
data[count] = '\0';
1246-
type = data[0];
12471245

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

12581256
sym = *result;
1259-
if (type == 's') {
1260-
symbolInfo();
1261-
emit showDebugChanged(true);
1262-
free(result);
1263-
delete data;
1264-
return;
1265-
}
12661257

1267-
/* URL is a menu */
1258+
/* Seek for the menu which holds the symbol */
12681259
for (struct property *prop = sym->prop; prop; prop = prop->next) {
12691260
if (prop->type != P_PROMPT && prop->type != P_MENU)
12701261
continue;
@@ -1273,16 +1264,13 @@ void ConfigInfoView::clicked(const QUrl &url)
12731264
}
12741265

12751266
if (!m) {
1276-
qInfo() << "Clicked menu is invalid:" << data;
1277-
free(result);
1278-
delete data;
1279-
return;
1267+
/* Symbol is not visible as a menu */
1268+
symbolInfo();
1269+
emit showDebugChanged(true);
1270+
} else {
1271+
emit menuSelected(m);
12801272
}
12811273

1282-
_menu = m;
1283-
menuInfo();
1284-
1285-
emit showDebugChanged(true);
12861274
free(result);
12871275
delete data;
12881276
}
@@ -1731,6 +1719,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
17311719
list->setSelected(item, true);
17321720
list->scrollToItem(item);
17331721
list->setFocus();
1722+
helpText->setInfo(menu);
17341723
}
17351724
}
17361725
}

0 commit comments

Comments
 (0)