aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypeloaderqmldircontent.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2020-02-27 10:49:14 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2020-03-02 10:35:50 +0100
commit8ab237edf170f5b0482dccf5169868e5c7c47771 (patch)
treecca2d3faa0a8553a452d9139ac7442c3da25c0f8 /src/qml/qml/qqmltypeloaderqmldircontent.cpp
parentd8f6f41c334d14c4712b1dc16554f80bb1290e24 (diff)
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 <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypeloaderqmldircontent.cpp')
-rw-r--r--src/qml/qml/qqmltypeloaderqmldircontent.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/qml/qqmltypeloaderqmldircontent.cpp b/src/qml/qml/qqmltypeloaderqmldircontent.cpp
index 860971d296..714ea79e67 100644
--- a/src/qml/qml/qqmltypeloaderqmldircontent.cpp
+++ b/src/qml/qml/qqmltypeloaderqmldircontent.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include <private/qqmltypeloaderqmldircontent_p.h>
+#include <private/qqmlsourcecoordinate_p.h>
#include <QtQml/qqmlerror.h>
QT_BEGIN_NAMESPACE
@@ -59,8 +60,8 @@ QList<QQmlError> QQmlTypeLoaderQmldirContent::errors(const QString &uri) const
for (const auto &parseError : parseErrors) {
QQmlError error;
error.setUrl(url);
- error.setLine(parseError.line);
- error.setColumn(parseError.column);
+ error.setLine(qmlConvertSourceCoordinate<quint32, int>(parseError.loc.startLine));
+ error.setColumn(qmlConvertSourceCoordinate<quint32, int>(parseError.loc.startColumn));
error.setDescription(parseError.message);
errors.append(error);
}
@@ -83,8 +84,8 @@ void QQmlTypeLoaderQmldirContent::setContent(const QString &location, const QStr
void QQmlTypeLoaderQmldirContent::setError(const QQmlError &error)
{
QQmlJS::DiagnosticMessage parseError;
- parseError.line = error.line();
- parseError.column = error.column();
+ parseError.loc.startLine = error.line();
+ parseError.loc.startColumn = error.column();
parseError.message = error.description();
m_parser.setError(parseError);
}