aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljscompiler.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-10-13 09:19:56 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-10-20 21:37:57 +0200
commitbc528a0770150e3fde1fdab7b699379bc736b9e1 (patch)
treecd994d53bb285dd2dc0113977a4db4b395f85ff5 /src/qmlcompiler/qqmljscompiler.cpp
parentb94bbd7a0b032eb6428d44bfb86feac577786a1f (diff)
QmlCompiler: Add a separate flag for the "pragma Strict" check
We want to trigger the qFatal() when running qmlcachegen or qmlsc, but we don't want to trigger it in qmllint, even if we are using the same QtMsgType for the severity of the messages. In turn, demote qmlCompiler messages to QtWarningMsg in qmlcachegen. Pick-to: 6.4 Task-number: QTBUG-107168 Change-Id: Ib660df41742b2d426241eb29ac4c91f4933c5ba1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler.cpp')
-rw-r--r--src/qmlcompiler/qqmljscompiler.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp
index 8bc55d2251..5bd7a7f0b0 100644
--- a/src/qmlcompiler/qqmljscompiler.cpp
+++ b/src/qmlcompiler/qqmljscompiler.cpp
@@ -674,9 +674,8 @@ QQmlJS::DiagnosticMessage QQmlJSAotCompiler::diagnose(
const QString &message, QtMsgType type, const QQmlJS::SourceLocation &location) const
{
if (isStrict(m_document)
- && (type == QtWarningMsg || type == QtCriticalMsg || type == QtFatalMsg)
- && !m_logger->isCategoryIgnored(qmlCompiler)
- && m_logger->categoryLevel(qmlCompiler) == QtCriticalMsg) {
+ && (type == QtWarningMsg || type == QtCriticalMsg || type == QtFatalMsg)
+ && m_logger->isCategoryFatal(qmlCompiler)) {
qFatal("%s:%d: (strict mode) %s",
qPrintable(QFileInfo(m_resourcePath).fileName()),
location.startLine, qPrintable(message));