QmlJS: Add more value_casts.

And switch all existing dynamic_casts to value_casts.

Change-Id: I93b89358e4802080f40b332074c64f4e91a2bc4c
Reviewed-on: http://codereview.qt-project.org/6311
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
Christian Kamm
2011-10-10 10:55:37 +02:00
parent 572b3a180b
commit 7ed717ca62
14 changed files with 161 additions and 63 deletions

View File

@@ -185,7 +185,7 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
iter.next();
while (iter.hasNext()) {
const ObjectValue *prototype = iter.next();
if (const CppComponentValue *qmlMetaObject = dynamic_cast<const CppComponentValue *>(prototype)) {
if (const CppComponentValue *qmlMetaObject = value_cast<CppComponentValue>(prototype)) {
if ((qmlMetaObject->className() == QLatin1String("ListElement")
|| qmlMetaObject->className() == QLatin1String("Connections")
) && (qmlMetaObject->moduleName() == QLatin1String("Qt")
@@ -211,7 +211,7 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
Evaluate evaluator(_scopeChain);
const Value *targetValue = evaluator(scriptBinding->statement);
if (const ObjectValue *target = value_cast<const ObjectValue *>(targetValue)) {
if (const ObjectValue *target = value_cast<ObjectValue>(targetValue)) {
qmlScopeObjects.prepend(target);
} else {
qmlScopeObjects.clear();
@@ -259,7 +259,7 @@ const ObjectValue *ScopeBuilder::isPropertyChangesObject(const ContextPtr &conte
PrototypeIterator iter(object, context);
while (iter.hasNext()) {
const ObjectValue *prototype = iter.next();
if (const CppComponentValue *qmlMetaObject = dynamic_cast<const CppComponentValue *>(prototype)) {
if (const CppComponentValue *qmlMetaObject = value_cast<CppComponentValue>(prototype)) {
if (qmlMetaObject->className() == QLatin1String("PropertyChanges")
&& (qmlMetaObject->moduleName() == QLatin1String("Qt")
|| qmlMetaObject->moduleName() == QLatin1String("QtQuick")))