diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-09-04 08:40:08 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-09-04 23:29:40 +0200 |
| commit | ae7419479a4a7e7777b0ce4272b8653c68a8d447 (patch) | |
| tree | cea9bb355ccfbe7993942525749f040b3db9740f | |
| parent | 003ee367f1c4fed186e2cc0176c8ab60c252942c (diff) | |
QmlCompiler: Log double colon if source location missing
This causes the lines logged to be shown in Qt Creator's issues pane.
Fixes: QTCREATORBUG-31526
Change-Id: I2c55d09a779cd4a51df5dda0e4ef894de235f974
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
| -rw-r--r-- | src/qmlcompiler/qqmljslogger.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qmlcompiler/qqmljslogger.cpp b/src/qmlcompiler/qqmljslogger.cpp index 7bf686018d..cc7a44db93 100644 --- a/src/qmlcompiler/qqmljslogger.cpp +++ b/src/qmlcompiler/qqmljslogger.cpp @@ -255,10 +255,9 @@ void QQmlJSLogger::log(const QString &message, QQmlJS::LoggerWarningId id, (!overrideFileName.isEmpty() ? overrideFileName : m_fileName) + QStringLiteral(":"); if (srcLocation.isValid()) - prefix += QStringLiteral("%1:%2:").arg(srcLocation.startLine).arg(srcLocation.startColumn); - - if (!prefix.isEmpty()) - prefix.append(QLatin1Char(' ')); + prefix += QStringLiteral("%1:%2: ").arg(srcLocation.startLine).arg(srcLocation.startColumn); + else if (!prefix.isEmpty()) + prefix += QStringLiteral(": "); // produce double colon for Qt Creator's issues pane // Note: we do the clamping to [Info, Critical] range since our logger only // supports 3 categories |
