Clang: Polish tool tip text for diagnostic

* Set the category apart.
* Show only the disable option and only in debug mode.

Change-Id: If5f65f9bd04c8e37e376a9862035005f4456394a
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-10-13 18:46:55 +02:00
parent d3583883a8
commit ebce521ef9

View File

@@ -94,15 +94,16 @@ bool isHelpfulChildDiagnostic(const ClangBackEnd::DiagnosticContainer &parentDia
QString diagnosticText(const ClangBackEnd::DiagnosticContainer &diagnostic)
{
QString text = diagnostic.category().toString()
+ QStringLiteral(" ")
+ QStringLiteral("\n\n")
+ diagnostic.text().toString();
if (!diagnostic.enableOption().isEmpty()) {
text += QStringLiteral(" (clang option: ")
+ diagnostic.enableOption().toString()
+ QStringLiteral(" disable with: ")
#ifdef QT_DEBUG
if (!diagnostic.disableOption().isEmpty()) {
text += QStringLiteral(" (disable with ")
+ diagnostic.disableOption().toString()
+ QStringLiteral(")");
}
#endif
for (auto &&childDiagnostic : diagnostic.children()) {
if (isHelpfulChildDiagnostic(diagnostic, childDiagnostic))