From 55d0327ddf2b7b59d686218a9eb7f340732136ef Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 20 Jul 2018 15:04:16 +0200 Subject: Clean up QQmlCustomParser API Consistently provide a smart pointer to the compilation unit in the two virtual functions. Change-Id: I2f43d4d17102082577f2502424d288d40eb7479d Reviewed-by: Lars Knoll --- tests/auto/qml/qqmllanguage/testtypes.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/auto/qml/qqmllanguage/testtypes.cpp') diff --git a/tests/auto/qml/qqmllanguage/testtypes.cpp b/tests/auto/qml/qqmllanguage/testtypes.cpp index 7e247b1906..d5670d906f 100644 --- a/tests/auto/qml/qqmllanguage/testtypes.cpp +++ b/tests/auto/qml/qqmllanguage/testtypes.cpp @@ -125,7 +125,7 @@ QVariant myCustomVariantTypeConverter(const QString &data) } -void CustomBindingParser::applyBindings(QObject *object, QV4::CompiledData::CompilationUnit *compilationUnit, const QList &bindings) +void CustomBindingParser::applyBindings(QObject *object, const QQmlRefPointer &compilationUnit, const QList &bindings) { CustomBinding *customBinding = qobject_cast(object); Q_ASSERT(customBinding); @@ -154,7 +154,7 @@ void CustomBinding::componentComplete() } } -void EnumSupportingCustomParser::verifyBindings(const QV4::CompiledData::Unit *qmlUnit, const QList &bindings) +void EnumSupportingCustomParser::verifyBindings(const QQmlRefPointer &compilationUnit, const QList &bindings) { if (bindings.count() != 1) { error(bindings.first(), QStringLiteral("Custom parser invoked incorrectly for unit test")); @@ -162,7 +162,7 @@ void EnumSupportingCustomParser::verifyBindings(const QV4::CompiledData::Unit *q } const QV4::CompiledData::Binding *binding = bindings.first(); - if (qmlUnit->stringAt(binding->propertyNameIndex) != QStringLiteral("foo")) { + if (compilationUnit->stringAt(binding->propertyNameIndex) != QStringLiteral("foo")) { error(binding, QStringLiteral("Custom parser invoked with the wrong property name")); return; } @@ -171,7 +171,7 @@ void EnumSupportingCustomParser::verifyBindings(const QV4::CompiledData::Unit *q error(binding, QStringLiteral("Custom parser invoked with the wrong property value. Expected script that evaluates to enum")); return; } - QByteArray script = qmlUnit->stringAt(binding->stringIndex).toUtf8(); + QByteArray script = compilationUnit->stringAt(binding->stringIndex).toUtf8(); bool ok; int v = evaluateEnum(script, &ok); if (!ok) { @@ -184,7 +184,7 @@ void EnumSupportingCustomParser::verifyBindings(const QV4::CompiledData::Unit *q } } -void SimpleObjectCustomParser::applyBindings(QObject *object, QV4::CompiledData::CompilationUnit *, const QList &bindings) +void SimpleObjectCustomParser::applyBindings(QObject *object, const QQmlRefPointer &, const QList &bindings) { SimpleObjectWithCustomParser *o = qobject_cast(object); Q_ASSERT(o); -- cgit v1.2.3