From ba7edffda3f360955825c3ef886ec232c0b2022b Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 16 Sep 2015 16:11:34 +0200 Subject: Remove some dead code Also get rid of the unnecessary QQmlCustomCompilerBackend interface. Change-Id: I6cfdd88ef49d3d314d07aa069da481d304e7a285 Reviewed-by: Lars Knoll --- src/qml/qml/qqmlcustomparser.cpp | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'src/qml/qml/qqmlcustomparser.cpp') diff --git a/src/qml/qml/qqmlcustomparser.cpp b/src/qml/qml/qqmlcustomparser.cpp index ebca9d2718..ec88ee015a 100644 --- a/src/qml/qml/qqmlcustomparser.cpp +++ b/src/qml/qml/qqmlcustomparser.cpp @@ -34,6 +34,7 @@ #include "qqmlcustomparser_p.h" #include "qqmlcompiler_p.h" +#include #include @@ -158,35 +159,9 @@ int QQmlCustomParser::evaluateEnum(const QByteArray& script, bool *ok) const to type-check object nodes. */ const QMetaObject *QQmlCustomParser::resolveType(const QString& name) const -{ - return compiler->resolveType(name); -} - -int QQmlCustomParserCompilerBackend::evaluateEnum(const QString &scope, const QByteArray &enumValue, bool *ok) const -{ - Q_ASSERT_X(ok, "QQmlCompiler::evaluateEnum", "ok must not be a null pointer"); - *ok = false; - - if (scope != QLatin1String("Qt")) { - QQmlType *type = 0; - imports().resolveType(scope, &type, 0, 0, 0); - return type ? type->enumValue(QHashedCStringRef(enumValue.constData(), enumValue.length()), ok) : -1; - } - - const QMetaObject *mo = StaticQtMetaObject::get(); - int i = mo->enumeratorCount(); - while (i--) { - int v = mo->enumerator(i).keyToValue(enumValue.constData(), ok); - if (*ok) - return v; - } - return -1; -} - -const QMetaObject *QQmlCustomParserCompilerBackend::resolveType(const QString &name) const { QQmlType *qmltype = 0; - if (!imports().resolveType(name, &qmltype, 0, 0, 0)) + if (!validator->imports().resolveType(name, &qmltype, 0, 0, 0)) return 0; if (!qmltype) return 0; -- cgit v1.2.3