From 8ab237edf170f5b0482dccf5169868e5c7c47771 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 27 Feb 2020 10:49:14 +0100 Subject: Restore offset/length in QQmlJS::DiagnosticMessage This is needed in a few places outside of declarative, so this change restores the loc member in DiagnosticMessage and moves QQmlJS::AST::SourceLocation into common's QQmlJS namespace/directory. QQmlError is unaffected and retains only line/column. Amends d4d197d06279f9257647628f7e1ccc9ec763a6bb Change-Id: Ifb9d344228e3c6e9e26fc4fe112686f9336ea2b2 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/qml/qqmldirparser') diff --git a/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp b/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp index bc4ba9437c..7e96205743 100644 --- a/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp +++ b/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp @@ -63,10 +63,10 @@ namespace { for (const QQmlJS::DiagnosticMessage &e : errors) { QString errorString = QLatin1String("qmldir"); - if (e.line > 0) { - errorString += QLatin1Char(':') + QString::number(e.line); - if (e.column > 0) - errorString += QLatin1Char(':') + QString::number(e.column); + if (e.loc.startLine > 0) { + errorString += QLatin1Char(':') + QString::number(e.loc.startLine); + if (e.loc.startColumn > 0) + errorString += QLatin1Char(':') + QString::number(e.loc.startColumn); } errorString += QLatin1String(": ") + e.message; -- cgit v1.2.3