diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-01-20 14:02:11 +0100 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2025-01-22 13:25:20 +0000 |
| commit | abf4a0951d614ae3558456771d91d8fdec1b1fbe (patch) | |
| tree | 637ac211ad2ccffbc337165eb2ea9adecd502b62 /tools | |
| parent | d92ddceaa35fae66fc13c012941005aa9dd5a158 (diff) | |
QmlCompiler: Introduce transactions for the logger
Certain compile passes may be run multiple times and only the last run
counts. We need to be able to roll back the logger to the state before
the pass in that case.
Amends commit d70abd83dc94d722cde6d4b19b9d35c5f4f19946
Task-number: QTBUG-124913
Change-Id: Ie6174fc3d6ce60ca3f0a3fa27484a58e6febcc17
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d3492ff7c105a9d85434c125655e6668f0befd9a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/qmllint/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/qmllint/main.cpp b/tools/qmllint/main.cpp index 962cb10839..2898bb6f9e 100644 --- a/tools/qmllint/main.cpp +++ b/tools/qmllint/main.cpp @@ -429,11 +429,11 @@ All warnings can be set to three levels: qmldirFiles, resourceFiles, categories); } success &= (lintResult == QQmlJSLinter::LintSuccess || lintResult == QQmlJSLinter::HasWarnings); - if (success) - { - int value = parser.isSet(maxWarnings) ? parser.value(maxWarnings).toInt() - : settings.value(maxWarningsSetting).toInt(); - if (value != -1 && value < linter.logger()->warnings().size()) + if (success) { + const qsizetype value = parser.isSet(maxWarnings) + ? parser.value(maxWarnings).toInt() + : settings.value(maxWarningsSetting).toInt(); + if (value != -1 && value < linter.logger()->numWarnings()) success = false; } |
