MCPcopy Create free account
hub / github.com/coreboot/coreboot / clicked

Method clicked

util/kconfig/qconf.cc:1173–1218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1171}
1172
1173void ConfigInfoView::clicked(const QUrl &url)
1174{
1175 QByteArray str = url.toEncoded();
1176 const std::size_t count = str.size();
1177 char *data = new char[count + 1];
1178 struct symbol **result;
1179 struct menu *m = NULL;
1180
1181 if (count < 1) {
1182 delete[] data;
1183 return;
1184 }
1185
1186 memcpy(data, str.constData(), count);
1187 data[count] = '\0';
1188
1189 /* Seek for exact match */
1190 data[0] = '^';
1191 strcat(data, "$");
1192 result = sym_re_search(data);
1193 if (!result) {
1194 delete[] data;
1195 return;
1196 }
1197
1198 sym = *result;
1199
1200 /* Seek for the menu which holds the symbol */
1201 for (struct property *prop = sym->prop; prop; prop = prop->next) {
1202 if (prop->type != P_PROMPT && prop->type != P_MENU)
1203 continue;
1204 m = prop->menu;
1205 break;
1206 }
1207
1208 if (!m) {
1209 /* Symbol is not visible as a menu */
1210 symbolInfo();
1211 emit showDebugChanged(true);
1212 } else {
1213 emit menuSelected(m);
1214 }
1215
1216 free(result);
1217 delete[] data;
1218}
1219
1220void ConfigInfoView::contextMenuEvent(QContextMenuEvent *event)
1221{

Callers

nothing calls this directly

Calls 4

strcatFunction · 0.85
sym_re_searchFunction · 0.85
memcpyFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected