MCPcopy Create free account
hub / github.com/KDE/kdevelop / verboseMessageToHtml

Function verboseMessageToHtml

plugins/cppcheck/parser.cpp:42–54  ·  view source on GitHub ↗

* Convert the value of \ attribute of \ element from cppcheck's * XML-output to 'good-looking' HTML-version. This is necessary because the * displaying of the original message is performed without line breaks - such * tooltips are uncomfortable to read, and large messages will not fit into the * screen. * * This function put the original message into \ tag that autom

Source from the content-addressed store, hash-verified

40 * @return HTML version for displaying in problem's tooltip
41 */
42QString verboseMessageToHtml( const QString & input )
43{
44 QString output(QStringLiteral("<html>%1</html>").arg(input.toHtmlEscaped()));
45
46 output.replace(QLatin1String("\\012"), QLatin1String("\n"));
47
48 if (output.count(QLatin1Char('\n')) >= 2) {
49 output.replace(output.indexOf(QLatin1Char('\n')), 1, QStringLiteral("<pre>") );
50 output.replace(output.lastIndexOf(QLatin1Char('\n')), 1, QStringLiteral("</pre><br>") );
51 }
52
53 return output;
54}
55
56CppcheckParser::CppcheckParser()
57{

Callers 1

startElementMethod · 0.70

Calls 4

toHtmlEscapedMethod · 0.80
replaceMethod · 0.45
countMethod · 0.45
indexOfMethod · 0.45

Tested by

no test coverage detected