aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2020-10-28 13:25:38 +0100
committerDavid Skoland <david.skoland@qt.io>2020-10-28 14:44:47 +0100
commit27bd9cab73a1e7e3d66e6025ace8510f932c5df8 (patch)
tree4c92072c9a15d681d1c6cdca97f35db88ca7dae2 /src/plugins
parent535adf8d9f6d26d4e9598a9276f23f938fcc7753 (diff)
Standardize QJsonArray iteration
When using refs as loop variables, the clang compiler complains (with default settings). This prevents that. Note that QJsonValueRef is used "behind the scenes", which makes this iteration method correct. Change-Id: I5a5f58ca8ad3887bce2009231cbae5a57c107697 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
index a70941682b..c4faeea7c9 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
@@ -219,7 +219,7 @@ void ValueLookupJob::run()
scopeObject.data());
}
QV4::ScopedStackFrame frame(scope, qmlContext);
- for (const QJsonValue &handle : handles) {
+ for (const QJsonValue handle : handles) {
QV4DataCollector::Ref ref = handle.toInt();
if (!collector->isValidRef(ref)) {
exception = QString::fromLatin1("Invalid Ref: %1").arg(ref);
diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
index a8403e15e2..8791a6119f 100644
--- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
@@ -479,7 +479,7 @@ void NativeDebugger::handleVariables(QJsonObject *response, const QJsonObject &a
Collector collector(engine);
const QJsonArray expanded = arguments.value(QLatin1String("expanded")).toArray();
- for (const QJsonValue &ex : expanded)
+ for (const QJsonValue ex : expanded)
collector.m_expanded.append(ex.toString());
TRACE_PROTOCOL("Expanded: " << collector.m_expanded);
@@ -522,7 +522,7 @@ void NativeDebugger::handleExpressions(QJsonObject *response, const QJsonObject
Collector collector(engine);
const QJsonArray expanded = arguments.value(QLatin1String("expanded")).toArray();
- for (const QJsonValue &ex : expanded)
+ for (const QJsonValue ex : expanded)
collector.m_expanded.append(ex.toString());
TRACE_PROTOCOL("Expanded: " << collector.m_expanded);
@@ -530,7 +530,7 @@ void NativeDebugger::handleExpressions(QJsonObject *response, const QJsonObject
QV4::Scope scope(engine);
const QJsonArray expressions = arguments.value(QLatin1String("expressions")).toArray();
- for (const QJsonValue &expr : expressions) {
+ for (const QJsonValue expr : expressions) {
QString expression = expr.toObject().value(QLatin1String("expression")).toString();
QString name = expr.toObject().value(QLatin1String("name")).toString();
TRACE_PROTOCOL("Evaluate expression: " << expression);