diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-09-16 16:11:34 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-09-21 19:59:23 +0000 |
commit | ba7edffda3f360955825c3ef886ec232c0b2022b (patch) | |
tree | f4c2aabf67edc23eaf03e006ad768ebeae2544c7 /src/qml/qml/qqmlcustomparser.cpp | |
parent | 0f29340a10b9638666ded939b4f6bf3d891f1320 (diff) |
Remove some dead code
Also get rid of the unnecessary QQmlCustomCompilerBackend interface.
Change-Id: I6cfdd88ef49d3d314d07aa069da481d304e7a285
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlcustomparser.cpp')
-rw-r--r-- | src/qml/qml/qqmlcustomparser.cpp | 29 |
1 files changed, 2 insertions, 27 deletions
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 <private/qqmltypecompiler_p.h> #include <QtCore/qdebug.h> @@ -159,34 +160,8 @@ int QQmlCustomParser::evaluateEnum(const QByteArray& script, bool *ok) const */ 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; |