Use FileName in TextMark

Change-Id: I3666d95dc8ef3b7da099d6d30f5cb4678a349493
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2018-05-02 15:02:00 +02:00
parent 8559df7bc9
commit 45f8d221bf
23 changed files with 84 additions and 65 deletions

View File

@@ -610,8 +610,7 @@ void QmlJSEditorDocumentPrivate::createTextMarks(const QList<DiagnosticMessage>
delete mark;
};
auto mark = new QmlJSTextMark(q->filePath().toString(),
diagnostic, onMarkRemoved);
auto mark = new QmlJSTextMark(q->filePath(), diagnostic, onMarkRemoved);
m_diagnosticMarks.append(mark);
q->addMark(mark);
}
@@ -630,13 +629,13 @@ void QmlJSEditorDocumentPrivate::createTextMarks(const SemanticInfo &info)
delete mark;
};
for (const DiagnosticMessage &diagnostic : qAsConst(info.semanticMessages)) {
auto mark = new QmlJSTextMark(q->filePath().toString(),
auto mark = new QmlJSTextMark(q->filePath(),
diagnostic, onMarkRemoved);
m_semanticMarks.append(mark);
q->addMark(mark);
}
for (const QmlJS::StaticAnalysis::Message &message : qAsConst(info.staticAnalysisMessages)) {
auto mark = new QmlJSTextMark(q->filePath().toString(),
auto mark = new QmlJSTextMark(q->filePath(),
message, onMarkRemoved);
m_semanticMarks.append(mark);
q->addMark(mark);

View File

@@ -32,6 +32,7 @@
using namespace QmlJSEditor;
using namespace QmlJSEditor::Internal;
using namespace Utils;
using namespace TextEditor;
@@ -58,7 +59,7 @@ static Core::Id cartegoryForSeverity(QmlJS::Severity::Enum kind)
return isWarning(kind) ? QMLJS_WARNING : QMLJS_ERROR;
}
QmlJSTextMark::QmlJSTextMark(const QString &fileName,
QmlJSTextMark::QmlJSTextMark(const FileName &fileName,
const QmlJS::DiagnosticMessage &diagnostic,
const QmlJSTextMark::RemovedFromEditorHandler &removedHandler)
: TextEditor::TextMark(fileName, int(diagnostic.loc.startLine),
@@ -69,7 +70,7 @@ QmlJSTextMark::QmlJSTextMark(const QString &fileName,
init(isWarning(diagnostic.kind), diagnostic.message);
}
QmlJSTextMark::QmlJSTextMark(const QString &fileName,
QmlJSTextMark::QmlJSTextMark(const FileName &fileName,
const QmlJS::StaticAnalysis::Message &message,
const QmlJSTextMark::RemovedFromEditorHandler &removedHandler)
: TextEditor::TextMark(fileName, int(message.location.startLine),

View File

@@ -38,10 +38,10 @@ class QmlJSTextMark : public TextEditor::TextMark
public:
using RemovedFromEditorHandler = std::function<void(QmlJSTextMark *)>;
QmlJSTextMark(const QString &fileName,
QmlJSTextMark(const Utils::FileName &fileName,
const QmlJS::DiagnosticMessage &diagnostic,
const RemovedFromEditorHandler &removedHandler);
QmlJSTextMark(const QString &fileName,
QmlJSTextMark(const Utils::FileName &fileName,
const QmlJS::StaticAnalysis::Message &message,
const RemovedFromEditorHandler &removedHandler);