diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-12 11:38:08 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-15 09:37:06 +0200 |
commit | ed9ffa109eb2f242b59443ad430204a90c8028c4 (patch) | |
tree | 6bc947fc1b2083bda907be03fac18d97b32a670a /src/qmlcompiler/qqmljsimportvisitor.cpp | |
parent | 9344fcf1a6f4dc6c8176912ac7f2c37e05bf873f (diff) |
qmllint: Unify the printing of diagnostics
We can use QQmlJS::DiagnosticMessage to carry message, type, and
location.
Change-Id: I3868bc8035b4da13efad0d1b7d2f8dfeff1ef234
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsimportvisitor.cpp')
-rw-r--r-- | src/qmlcompiler/qqmljsimportvisitor.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp index 87f9bc086e..0b79339b62 100644 --- a/src/qmlcompiler/qqmljsimportvisitor.cpp +++ b/src/qmlcompiler/qqmljsimportvisitor.cpp @@ -138,10 +138,12 @@ bool QQmlJSImportVisitor::visit(UiSourceElement *sourceElement) // nothing to do } else { const auto loc = sourceElement->firstSourceLocation(); - m_errors.append( - QStringLiteral("unsupportedd sourceElement at ") - + QString::fromLatin1("%1:%2: ").arg(loc.startLine).arg(loc.startColumn) - + QString::number(sourceElement->sourceElement->kind)); + m_errors.append({ + QStringLiteral("unsupportedd sourceElement %1") + .arg(sourceElement->sourceElement->kind), + QtWarningMsg, + loc + }); } return true; } @@ -167,7 +169,11 @@ bool QQmlJSImportVisitor::visit(QQmlJS::AST::UiEnumDeclaration *uied) void QQmlJSImportVisitor::throwRecursionDepthError() { - m_errors.append(QStringLiteral("Maximum statement or expression depth exceeded")); + m_errors.append({ + QStringLiteral("Maximum statement or expression depth exceeded"), + QtCriticalMsg, + QQmlJS::SourceLocation() + }); } QT_END_NAMESPACE |