summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-10-13 18:46:55 +0200
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-10-19 09:21:13 +0000
commitebce521ef936df06ad66f02dbbe304542cb85059 (patch)
tree85ea7458acdaafe2af80002d40e1da6ea5524866
parentd3583883a8b36fc32a26941a5b9bd747fb6776ae (diff)
downloadqt-creator-ebce521ef936df06ad66f02dbbe304542cb85059.tar.gz
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>
-rw-r--r--src/plugins/clangcodemodel/clangdiagnosticmanager.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp
index 5baaaceb5e..6c46c05b76 100644
--- a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp
+++ b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp
@@ -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))