Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kconfig: qconf: refactor ConfigInfoView::clicked()

Most of the code in ConfigInfoView::clicked() is unnecessary.
There is no need to use the regular expression to search for a symbol.
Calling sym_find() is simpler and faster.

The hyperlink always begins with the "s" tag, and there is no other
tag used. Remove it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+6 -37
+6 -37
scripts/kconfig/qconf.cc
··· 1001 1001 if (sym->name) { 1002 1002 stream << " ("; 1003 1003 if (showDebug()) 1004 - stream << "<a href=\"s" << sym->name << "\">"; 1004 + stream << "<a href=\"" << sym->name << "\">"; 1005 1005 stream << print_filter(sym->name); 1006 1006 if (showDebug()) 1007 1007 stream << "</a>"; ··· 1010 1010 } else if (sym->name) { 1011 1011 stream << "<big><b>"; 1012 1012 if (showDebug()) 1013 - stream << "<a href=\"s" << sym->name << "\">"; 1013 + stream << "<a href=\"" << sym->name << "\">"; 1014 1014 stream << print_filter(sym->name); 1015 1015 if (showDebug()) 1016 1016 stream << "</a>"; ··· 1124 1124 QTextStream *stream = reinterpret_cast<QTextStream *>(data); 1125 1125 1126 1126 if (sym && sym->name && !(sym->flags & SYMBOL_CONST)) { 1127 - *stream << "<a href=\"s" << sym->name << "\">"; 1127 + *stream << "<a href=\"" << sym->name << "\">"; 1128 1128 *stream << print_filter(str); 1129 1129 *stream << "</a>"; 1130 1130 } else { ··· 1134 1134 1135 1135 void ConfigInfoView::clicked(const QUrl &url) 1136 1136 { 1137 - QByteArray str = url.toEncoded(); 1138 - const std::size_t count = str.size(); 1139 - char *data = new char[count + 2]; // '$' + '\0' 1140 - struct symbol **result; 1141 - struct menu *m = NULL; 1137 + struct menu *m; 1142 1138 1143 - if (count < 1) { 1144 - delete[] data; 1145 - return; 1146 - } 1139 + sym = sym_find(url.toEncoded().constData()); 1147 1140 1148 - memcpy(data, str.constData(), count); 1149 - data[count] = '\0'; 1150 - 1151 - /* Seek for exact match */ 1152 - data[0] = '^'; 1153 - strcat(data, "$"); 1154 - result = sym_re_search(data); 1155 - if (!result) { 1156 - delete[] data; 1157 - return; 1158 - } 1159 - 1160 - sym = *result; 1161 - 1162 - /* Seek for the menu which holds the symbol */ 1163 - for (struct property *prop = sym->prop; prop; prop = prop->next) { 1164 - if (prop->type != P_PROMPT && prop->type != P_MENU) 1165 - continue; 1166 - m = prop->menu; 1167 - break; 1168 - } 1169 - 1141 + m = sym_get_prompt_menu(sym); 1170 1142 if (!m) { 1171 1143 /* Symbol is not visible as a menu */ 1172 1144 symbolInfo(); ··· 1146 1174 } else { 1147 1175 emit menuSelected(m); 1148 1176 } 1149 - 1150 - free(result); 1151 - delete[] data; 1152 1177 } 1153 1178 1154 1179 void ConfigInfoView::contextMenuEvent(QContextMenuEvent *event)