forked from qt-creator/qt-creator
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:
@@ -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")))
|
||||
|
||||
Reference in New Issue
Block a user