diff options
author | David Schulz <[email protected]> | 2020-07-21 13:11:01 +0200 |
---|---|---|
committer | David Schulz <[email protected]> | 2020-08-28 07:20:19 +0000 |
commit | 7f562c4d33a042fe51946c273581b2e9ad64159f (patch) | |
tree | 7ee57da51bee2284d79ad709559eb7d04df88093 /src/plugins/clangtools/clangtoolsdiagnostic.cpp | |
parent | 431479599221e4b62c2fdb501cd8e508e06dce88 (diff) |
ClangTools: Add diagnostic mark class
These marks can now be disabled.
This greys out the annotation color and the icon of the mark.
Change-Id: I5af4591db4baaaef55c986252f77d5d977427b56
Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/clangtools/clangtoolsdiagnostic.cpp')
-rw-r--r-- | src/plugins/clangtools/clangtoolsdiagnostic.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/clangtools/clangtoolsdiagnostic.cpp b/src/plugins/clangtools/clangtoolsdiagnostic.cpp index 1623d2f6b45..7fe7098c22f 100644 --- a/src/plugins/clangtools/clangtoolsdiagnostic.cpp +++ b/src/plugins/clangtools/clangtoolsdiagnostic.cpp @@ -25,6 +25,8 @@ #include "clangtoolsdiagnostic.h" +#include <utils/utilsicons.h> + namespace ClangTools { namespace Internal { @@ -47,6 +49,19 @@ bool Diagnostic::isValid() const return !description.isEmpty(); } +QIcon Diagnostic::icon() const +{ + if (type == "warning") + return Utils::Icons::CODEMODEL_WARNING.icon(); + if (type == "error" || type == "fatal") + return Utils::Icons::CODEMODEL_ERROR.icon(); + if (type == "note") + return Utils::Icons::INFO.icon(); + if (type == "fix-it") + return Utils::Icons::CODEMODEL_FIXIT.icon(); + return {}; +} + quint32 qHash(const Diagnostic &diagnostic) { return qHash(diagnostic.name) |