forked from qt-creator/qt-creator
ClangTools: Do not assume there is a corresponding open document
... when creating a TextMark.
Amends 2ad12b5b2c
.
Change-Id: Ic748012dadda0fc94814176589a3bdff20cb4cd6
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -20,10 +20,13 @@ using namespace Utils;
|
|||||||
namespace ClangTools {
|
namespace ClangTools {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
static TextMarkCategory clangToolsCategory()
|
||||||
|
{
|
||||||
|
return {Tr::tr("Clang Tools"), Id(Constants::DIAGNOSTIC_MARK_ID)};
|
||||||
|
}
|
||||||
|
|
||||||
DiagnosticMark::DiagnosticMark(const Diagnostic &diagnostic, TextDocument *document)
|
DiagnosticMark::DiagnosticMark(const Diagnostic &diagnostic, TextDocument *document)
|
||||||
: TextMark(document,
|
: TextMark(document, diagnostic.location.line, clangToolsCategory())
|
||||||
diagnostic.location.line,
|
|
||||||
{Tr::tr("Clang Tools"), Id(Constants::DIAGNOSTIC_MARK_ID)})
|
|
||||||
, m_diagnostic(diagnostic)
|
, m_diagnostic(diagnostic)
|
||||||
{
|
{
|
||||||
setSettingsPage(Constants::SETTINGS_PAGE_ID);
|
setSettingsPage(Constants::SETTINGS_PAGE_ID);
|
||||||
@@ -60,7 +63,8 @@ DiagnosticMark::DiagnosticMark(const Diagnostic &diagnostic, TextDocument *docum
|
|||||||
}
|
}
|
||||||
|
|
||||||
DiagnosticMark::DiagnosticMark(const Diagnostic &diagnostic)
|
DiagnosticMark::DiagnosticMark(const Diagnostic &diagnostic)
|
||||||
: DiagnosticMark(diagnostic, TextDocument::textDocumentForFilePath(diagnostic.location.filePath))
|
: TextMark(diagnostic.location.filePath, diagnostic.location.line, clangToolsCategory())
|
||||||
|
, m_diagnostic(diagnostic)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void DiagnosticMark::disable()
|
void DiagnosticMark::disable()
|
||||||
|
Reference in New Issue
Block a user