diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-03-06 16:55:09 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-07 15:33:19 +0100 |
commit | 99efe4309379482fce5c231885883e359bf85290 (patch) | |
tree | dbb9333a547fa1939bd63bd64136611e9fe82968 /tests/auto/qml/qqmllanguage/testtypes.cpp | |
parent | 9fc17c08e5635cf112c6194e6c24af2a9c7caf00 (diff) |
Remove old compiler and VME
This removes the bulk of the code. A few smaller cleanups remain, to be
done in smaller changes as they move code around.
Additionally the "optimize" option of qqmlbundle was removed. It called QQmlScript::Parser::preparseData,
which however was not implemented and always returned an empty QByteArray. Therefore "optimize" would not
do anything and the class is gone now :)
Change-Id: I0c265e756704cb53c5250be1f69e4a3e1b6e64d5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/testtypes.cpp')
-rw-r--r-- | tests/auto/qml/qqmllanguage/testtypes.cpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/tests/auto/qml/qqmllanguage/testtypes.cpp b/tests/auto/qml/qqmllanguage/testtypes.cpp index 895d5e75da..08d4d557fd 100644 --- a/tests/auto/qml/qqmllanguage/testtypes.cpp +++ b/tests/auto/qml/qqmllanguage/testtypes.cpp @@ -102,31 +102,6 @@ QVariant myCustomVariantTypeConverter(const QString &data) } -QByteArray CustomBindingParser::compile(const QList<QQmlCustomParserProperty> &properties) -{ - QByteArray result; - QDataStream ds(&result, QIODevice::WriteOnly); - - ds << properties.count(); - for (int i = 0; i < properties.count(); ++i) { - const QQmlCustomParserProperty &prop = properties.at(i); - ds << prop.name(); - - Q_ASSERT(prop.assignedValues().count() == 1); - QVariant value = prop.assignedValues().first(); - - Q_ASSERT(value.userType() == qMetaTypeId<QQmlScript::Variant>()); - QQmlScript::Variant v = qvariant_cast<QQmlScript::Variant>(value); - Q_ASSERT(v.type() == QQmlScript::Variant::Script); - int bindingId = bindingIdentifier(v, prop.name()); - ds << bindingId; - - ds << prop.location().line; - } - - return result; -} - QByteArray CustomBindingParser::compile(const QV4::CompiledData::QmlUnit *qmlUnit, int objectIndex, const QList<const QV4::CompiledData::Binding *> &bindings) { Q_UNUSED(objectIndex) @@ -180,49 +155,6 @@ void CustomBinding::componentComplete() } } - -QByteArray EnumSupportingCustomParser::compile(const QList<QQmlCustomParserProperty> &props) -{ - if (props.count() != 1) { - error(QStringLiteral("Custom parser invoked incorrectly for unit test")); - return QByteArray(); - } - QQmlCustomParserProperty prop = props.first(); - if (prop.name() != QStringLiteral("foo")) { - error(QStringLiteral("Custom parser invoked with the wrong property name")); - return QByteArray(); - } - - if (prop.assignedValues().count() != 1) { - error(QStringLiteral("Custom parser invoked with the wrong property values. Expected only one.")); - return QByteArray(); - } - - QVariant firstValue = prop.assignedValues().first(); - if (firstValue.userType() != qMetaTypeId<QQmlScript::Variant>()) { - error(QStringLiteral("Custom parser invoked with the wrong property value. Expected value instead of object or so")); - return QByteArray(); - } - QQmlScript::Variant value = qvariant_cast<QQmlScript::Variant>(firstValue); - if (!value.isScript()) { - error(QStringLiteral("Custom parser invoked with the wrong property value. Expected script that evaluates to enum")); - return QByteArray(); - } - QByteArray script = value.asScript().toUtf8(); - bool ok; - int v = evaluateEnum(script, &ok); - if (!ok) { - error(QStringLiteral("Custom parser invoked with the wrong property value. Script did not evaluate to enum")); - return QByteArray(); - } - if (v != MyEnum1Class::A_13) { - error(QStringLiteral("Custom parser invoked with the wrong property value. Enum value is not the expected value.")); - return QByteArray(); - } - - return QByteArray(); -} - QByteArray EnumSupportingCustomParser::compile(const QV4::CompiledData::QmlUnit *qmlUnit, int objectIndex, const QList<const QV4::CompiledData::Binding *> &bindings) { Q_UNUSED(qmlUnit) |