diff options
Diffstat (limited to 'src/qml/qml')
27 files changed, 80 insertions, 80 deletions
diff --git a/src/qml/qml/ftw/qhashedstring_p.h b/src/qml/qml/ftw/qhashedstring_p.h index 7a7786557e..da5878ed33 100644 --- a/src/qml/qml/ftw/qhashedstring_p.h +++ b/src/qml/qml/ftw/qhashedstring_p.h @@ -224,8 +224,8 @@ public: inline char *cStrData() const { return (char *)ckey; } inline quint16 *utf16Data() const { return (quint16 *)strData->data(); } - inline bool equals(const QV4::ValueRef string) const { - QString s = string->toQStringNoThrow(); + inline bool equals(const QV4::Value &string) const { + QString s = string.toQStringNoThrow(); if (isQString()) { QStringDataPtr dd; dd.ptr = strData; diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 91fa2aa7bd..a65f495293 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -137,14 +137,14 @@ QQmlBinding::QQmlBinding(const QString &str, QObject *obj, v4function.set(v4, qmlBinding(ctxt, obj, str, url, lineNumber)); } -QQmlBinding::QQmlBinding(const QV4::ValueRef functionPtr, QObject *obj, QQmlContextData *ctxt) +QQmlBinding::QQmlBinding(const QV4::Value &functionPtr, QObject *obj, QQmlContextData *ctxt) : QQmlJavaScriptExpression(&QQmlBinding_jsvtable), QQmlAbstractBinding(Binding) { setNotifyOnValueChanged(true); QQmlAbstractExpression::setContext(ctxt); setScopeObject(obj); - v4function.set(functionPtr->asObject()->engine(), functionPtr); + v4function.set(functionPtr.asObject()->engine(), functionPtr); } QQmlBinding::~QQmlBinding() diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h index 4a44f11cd4..aded349b4f 100644 --- a/src/qml/qml/qqmlbinding_p.h +++ b/src/qml/qml/qqmlbinding_p.h @@ -73,7 +73,7 @@ public: QQmlBinding(const QString &, QObject *, QQmlContextData *); QQmlBinding(const QString &, QObject *, QQmlContextData *, const QString &url, quint16 lineNumber, quint16 columnNumber); - QQmlBinding(const QV4::ValueRef, QObject *, QQmlContextData *); + QQmlBinding(const QV4::Value &, QObject *, QQmlContextData *); void setTarget(const QQmlProperty &); void setTarget(QObject *, const QQmlPropertyData &, QQmlContextData *); diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp index 811efcaef5..126996266f 100644 --- a/src/qml/qml/qqmlboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@ -86,10 +86,10 @@ QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index, init(ctxt, scope); } -QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index, QQmlContextData *ctxt, QObject *scope, const QV4::ValueRef &function) +QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index, QQmlContextData *ctxt, QObject *scope, const QV4::Value &function) : QQmlJavaScriptExpression(&QQmlBoundSignalExpression_jsvtable), m_index(index), - m_function(function->asObject()->engine(), function), + m_function(function.asObject()->engine(), function), m_target(target), m_extra(0) { diff --git a/src/qml/qml/qqmlboundsignal_p.h b/src/qml/qml/qqmlboundsignal_p.h index 6e0fbe90e6..0efd0a93a8 100644 --- a/src/qml/qml/qqmlboundsignal_p.h +++ b/src/qml/qml/qqmlboundsignal_p.h @@ -68,7 +68,7 @@ public: const QString ¶meterString = QString()); QQmlBoundSignalExpression(QObject *target, int index, - QQmlContextData *ctxt, QObject *scope, const QV4::ValueRef &function); + QQmlContextData *ctxt, QObject *scope, const QV4::Value &function); QQmlBoundSignalExpression(QObject *target, int index, QQmlContextData *ctxt, QObject *scope, QV4::Function *runtimeFunction); diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 5aed1bc0dc..e98529a25e 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -1383,7 +1383,7 @@ void QQmlComponent::incubateObject(QQmlV4Function *args) } // XXX used by QSGLoader -void QQmlComponentPrivate::initializeObjectWithInitialProperties(const QV4::ValueRef qmlGlobal, const QV4::ValueRef valuemap, QObject *toCreate) +void QQmlComponentPrivate::initializeObjectWithInitialProperties(const QV4::Value &qmlGlobal, const QV4::Value &valuemap, QObject *toCreate) { QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); QV4::ExecutionEngine *v4engine = QV8Engine::getV4(ep->v8engine()); @@ -1392,7 +1392,7 @@ void QQmlComponentPrivate::initializeObjectWithInitialProperties(const QV4::Valu QV4::ScopedValue object(scope, QV4::QObjectWrapper::wrap(v4engine, toCreate)); Q_ASSERT(object->asObject()); - if (!valuemap->isUndefined()) { + if (!valuemap.isUndefined()) { QV4::ScopedObject qmlGlobalObj(scope, qmlGlobal); QV4::ScopedFunctionObject f(scope, QV4::Script::evaluate(v4engine, QString::fromLatin1(INITIALPROPERTIES_SOURCE), qmlGlobalObj)); diff --git a/src/qml/qml/qqmlcomponent_p.h b/src/qml/qml/qqmlcomponent_p.h index 1dcc605ca4..f59c095b91 100644 --- a/src/qml/qml/qqmlcomponent_p.h +++ b/src/qml/qml/qqmlcomponent_p.h @@ -82,7 +82,7 @@ public: QObject *beginCreate(QQmlContextData *); void completeCreate(); - void initializeObjectWithInitialProperties(const QV4::ValueRef qmlGlobal, const QV4::ValueRef valuemap, QObject *toCreate); + void initializeObjectWithInitialProperties(const QV4::Value &qmlGlobal, const QV4::Value &valuemap, QObject *toCreate); QQmlTypeData *typeData; virtual void typeDataReady(QQmlTypeData *); diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp index 29f5152f77..946ea01565 100644 --- a/src/qml/qml/qqmlcontextwrapper.cpp +++ b/src/qml/qml/qqmlcontextwrapper.cpp @@ -99,23 +99,23 @@ QQmlContextData *QmlContextWrapper::callingContext(ExecutionEngine *v4) return !!c ? c->getContext() : 0; } -QQmlContextData *QmlContextWrapper::getContext(const ValueRef value) +QQmlContextData *QmlContextWrapper::getContext(const Value &value) { - if (!value->isObject()) + if (!value.isObject()) return 0; - QV4::ExecutionEngine *v4 = value->asObject()->engine(); + QV4::ExecutionEngine *v4 = value.asObject()->engine(); Scope scope(v4); QV4::Scoped<QmlContextWrapper> c(scope, value); return c ? c->getContext() : 0; } -void QmlContextWrapper::takeContextOwnership(const ValueRef qmlglobal) +void QmlContextWrapper::takeContextOwnership(const Value &qmlglobal) { - Q_ASSERT(qmlglobal->isObject()); + Q_ASSERT(qmlglobal.isObject()); - QV4::ExecutionEngine *v4 = qmlglobal->asObject()->engine(); + QV4::ExecutionEngine *v4 = qmlglobal.asObject()->engine(); Scope scope(v4); QV4::Scoped<QmlContextWrapper> c(scope, qmlglobal); Q_ASSERT(c); @@ -182,7 +182,7 @@ ReturnedValue QmlContextWrapper::get(Managed *m, String *name, bool *hasProperty if (hasProperty) *hasProperty = true; if (r.scriptIndex != -1) { - QV4::ScopedObject scripts(scope, context->importedScripts); + QV4::ScopedObject scripts(scope, context->importedScripts.valueRef()); return scripts->getIndexed(r.scriptIndex); } else if (r.type) { return QmlTypeWrapper::create(v4, scopeObject, r.type); @@ -265,7 +265,7 @@ ReturnedValue QmlContextWrapper::get(Managed *m, String *name, bool *hasProperty return Primitive::undefinedValue().asReturnedValue(); } -void QmlContextWrapper::put(Managed *m, String *name, const ValueRef value) +void QmlContextWrapper::put(Managed *m, String *name, const Value &value) { Q_ASSERT(m->as<QmlContextWrapper>()); QmlContextWrapper *resource = static_cast<QmlContextWrapper *>(m); diff --git a/src/qml/qml/qqmlcontextwrapper_p.h b/src/qml/qml/qqmlcontextwrapper_p.h index 96c7bc9af4..728484ee0a 100644 --- a/src/qml/qml/qqmlcontextwrapper_p.h +++ b/src/qml/qml/qqmlcontextwrapper_p.h @@ -95,16 +95,16 @@ struct Q_QML_EXPORT QmlContextWrapper : Object static ReturnedValue urlScope(ExecutionEngine *v4, const QUrl &); static QQmlContextData *callingContext(ExecutionEngine *v4); - static void takeContextOwnership(const ValueRef qmlglobal); + static void takeContextOwnership(const Value &qmlglobal); inline QObject *getScopeObject() const { return d()->scopeObject; } inline QQmlContextData *getContext() const { return d()->context; } - static QQmlContextData *getContext(const ValueRef value); + static QQmlContextData *getContext(const Value &value); void setReadOnly(bool b) { d()->readOnly = b; } static ReturnedValue get(Managed *m, String *name, bool *hasProperty); - static void put(Managed *m, String *name, const ValueRef value); + static void put(Managed *m, String *name, const Value &value); static void markObjects(Heap::Base *m, ExecutionEngine *engine); static void registerQmlDependencies(ExecutionEngine *context, const CompiledData::Function *compiledFunction); diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 5f8190b8dc..447ee76952 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -106,7 +106,7 @@ void QQmlJavaScriptExpression::resetNotifyOnValueChanged() } QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context, - const QV4::ValueRef function, bool *isUndefined) + const QV4::Value &function, bool *isUndefined) { QV4::ExecutionEngine *v4 = QV8Engine::getV4(context->engine); QV4::Scope scope(v4); @@ -116,13 +116,13 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context, } QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context, - const QV4::ValueRef function, + const QV4::Value &function, QV4::CallData *callData, bool *isUndefined) { Q_ASSERT(context && context->engine); - if (function->isUndefined()) { + if (function.isUndefined()) { if (isUndefined) *isUndefined = true; return QV4::Encode::undefined(); @@ -154,7 +154,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context, callData->thisObject = value; } - result = function->asFunctionObject()->call(callData); + result = function.asFunctionObject()->call(callData); if (scope.hasException()) { if (watcher.wasDeleted()) scope.engine->catchException(); // ignore exception diff --git a/src/qml/qml/qqmljavascriptexpression_p.h b/src/qml/qml/qqmljavascriptexpression_p.h index dc48c2458d..4d0727ed6b 100644 --- a/src/qml/qml/qqmljavascriptexpression_p.h +++ b/src/qml/qml/qqmljavascriptexpression_p.h @@ -102,8 +102,8 @@ public: QQmlJavaScriptExpression(VTable *vtable); - QV4::ReturnedValue evaluate(QQmlContextData *, const QV4::ValueRef function, bool *isUndefined); - QV4::ReturnedValue evaluate(QQmlContextData *, const QV4::ValueRef function, QV4::CallData *callData, bool *isUndefined); + QV4::ReturnedValue evaluate(QQmlContextData *, const QV4::Value &function, bool *isUndefined); + QV4::ReturnedValue evaluate(QQmlContextData *, const QV4::Value &function, QV4::CallData *callData, bool *isUndefined); inline bool notifyOnValueChanged() const; diff --git a/src/qml/qml/qqmllistwrapper.cpp b/src/qml/qml/qqmllistwrapper.cpp index af955ff15c..35adc063aa 100644 --- a/src/qml/qml/qqmllistwrapper.cpp +++ b/src/qml/qml/qqmllistwrapper.cpp @@ -130,7 +130,7 @@ ReturnedValue QmlListWrapper::getIndexed(Managed *m, uint index, bool *hasProper return Primitive::undefinedValue().asReturnedValue(); } -void QmlListWrapper::put(Managed *m, String *name, const ValueRef value) +void QmlListWrapper::put(Managed *m, String *name, const Value &value) { // doesn't do anything. Should we throw? Q_UNUSED(m); diff --git a/src/qml/qml/qqmllistwrapper_p.h b/src/qml/qml/qqmllistwrapper_p.h index 1c2ad03992..976acf421f 100644 --- a/src/qml/qml/qqmllistwrapper_p.h +++ b/src/qml/qml/qqmllistwrapper_p.h @@ -83,7 +83,7 @@ struct Q_QML_EXPORT QmlListWrapper : Object static ReturnedValue get(Managed *m, String *name, bool *hasProperty); static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty); - static void put(Managed *m, String *name, const ValueRef value); + static void put(Managed *m, String *name, const Value &value); static void advanceIterator(Managed *m, ObjectIterator *it, Heap::String **name, uint *index, Property *p, PropertyAttributes *attributes); }; diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp index 05cfd2e2a1..5a27739156 100644 --- a/src/qml/qml/qqmllocale.cpp +++ b/src/qml/qml/qqmllocale.cpp @@ -55,9 +55,9 @@ DEFINE_OBJECT_VTABLE(QQmlLocaleData); if (!r) \ V4THROW_ERROR("Not a valid Locale object") -static bool isLocaleObject(const QV4::ValueRef val) +static bool isLocaleObject(const QV4::Value &val) { - return val->as<QQmlLocaleData>(); + return val.as<QQmlLocaleData>(); } //-------------- diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 8c34fc3997..69b68be8a3 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -211,7 +211,7 @@ QObject *QQmlObjectCreator::create(int subComponentIndex, QObject *parent, QQmlI context->importedScripts.set(v4, scripts); for (int i = 0; i < compiledData->scripts.count(); ++i) { QQmlScriptData *s = compiledData->scripts.at(i); - scripts->putIndexed(i, s->scriptValueForContext(context)); + scripts->putIndexed(i, *s->scriptValueForContext(context).valueRef()); } } else if (sharedState->creationContext) { context->importedScripts = sharedState->creationContext->importedScripts; diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index abdb938e52..228f94503f 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -1459,7 +1459,7 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object, const QQmlPropertyData &core, QQmlContextData *context, QQmlJavaScriptExpression *expression, - const QV4::ValueRef result, bool isUndefined, + const QV4::Value &result, bool isUndefined, WriteFlags flags) { Q_ASSERT(object); @@ -1481,22 +1481,22 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object, if (!isUndefined && !core.isValueTypeVirtual()) { switch (core.propType) { case QMetaType::Int: - if (result->isInteger()) - QUICK_STORE(int, result->integerValue()) - else if (result->isNumber()) - QUICK_STORE(int, result->doubleValue()) + if (result.isInteger()) + QUICK_STORE(int, result.integerValue()) + else if (result.isNumber()) + QUICK_STORE(int, result.doubleValue()) break; case QMetaType::Double: - if (result->isNumber()) - QUICK_STORE(double, result->asDouble()) + if (result.isNumber()) + QUICK_STORE(double, result.asDouble()) break; case QMetaType::Float: - if (result->isNumber()) - QUICK_STORE(float, result->asDouble()) + if (result.isNumber()) + QUICK_STORE(float, result.asDouble()) break; case QMetaType::QString: - if (result->isString()) - QUICK_STORE(QString, result->toQStringNoThrow()) + if (result.isString()) + QUICK_STORE(QString, result.toQStringNoThrow()) break; default: break; @@ -1514,7 +1514,7 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object, if (isUndefined) { } else if (core.isQList()) { value = QV8Engine::getV4(v8engine)->toVariant(result, qMetaTypeId<QList<QObject *> >()); - } else if (result->isNull() && core.isQObject()) { + } else if (result.isNull() && core.isQObject()) { value = QVariant::fromValue((QObject *)0); } else if (core.propType == qMetaTypeId<QList<QUrl> >()) { value = resolvedUrlSequence(QV8Engine::getV4(v8engine)->toVariant(result, qMetaTypeId<QList<QUrl> >()), context); @@ -1525,7 +1525,7 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object, if (expression->hasError()) { return false; } else if (isVarProperty) { - QV4::FunctionObject *f = result->asFunctionObject(); + QV4::FunctionObject *f = result.asFunctionObject(); if (f && f->isBinding()) { // we explicitly disallow this case to avoid confusion. Users can still store one // in an array in a var property if they need to, but the common case is user error. @@ -1543,7 +1543,7 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object, } else if (isUndefined && type == qMetaTypeId<QVariant>()) { writeValueProperty(object, core, QVariant(), context, flags); } else if (type == qMetaTypeId<QJSValue>()) { - QV4::FunctionObject *f = result->asFunctionObject(); + QV4::FunctionObject *f = result.asFunctionObject(); if (f && f->isBinding()) { expression->delayedError()->setErrorDescription(QLatin1String("Invalid use of Qt.binding() in a binding declaration.")); expression->delayedError()->setErrorObject(object); @@ -1561,7 +1561,7 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object, expression->delayedError()->setErrorDescription(errorStr); expression->delayedError()->setErrorObject(object); return false; - } else if (QV4::FunctionObject *f = result->asFunctionObject()) { + } else if (QV4::FunctionObject *f = result.asFunctionObject()) { if (f->isBinding()) expression->delayedError()->setErrorDescription(QLatin1String("Invalid use of Qt.binding() in a binding declaration.")); else diff --git a/src/qml/qml/qqmlproperty_p.h b/src/qml/qml/qqmlproperty_p.h index 70b632c943..4cc9f479d8 100644 --- a/src/qml/qml/qqmlproperty_p.h +++ b/src/qml/qml/qqmlproperty_p.h @@ -140,7 +140,7 @@ public: static bool writeBinding(QObject *, const QQmlPropertyData &, QQmlContextData *context, QQmlJavaScriptExpression *expression, - const QV4::ValueRef result, bool isUndefined, + const QV4::Value &result, bool isUndefined, WriteFlags flags); static int valueTypeCoreIndex(const QQmlProperty &that); static int bindingIndex(const QQmlProperty &that); diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 2a000e34e1..7f4161494a 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -2506,10 +2506,10 @@ QV4::PersistentValue QQmlScriptData::scriptValueForContext(QQmlContextData *pare scriptsArray = v4->newArrayObject(scripts.count()); ctxt->importedScripts.set(v4, scriptsArray); } else { - scriptsArray = ctxt->importedScripts; + scriptsArray = ctxt->importedScripts.valueRef(); } for (int ii = 0; ii < scripts.count(); ++ii) - scriptsArray->putIndexed(ii, scripts.at(ii)->scriptData()->scriptValueForContext(ctxt)); + scriptsArray->putIndexed(ii, *scripts.at(ii)->scriptData()->scriptValueForContext(ctxt).valueRef()); if (!hasEngine()) initialize(parentCtxt->engine); diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp index 2c0972bced..c8cefb8a4c 100644 --- a/src/qml/qml/qqmltypewrapper.cpp +++ b/src/qml/qml/qqmltypewrapper.cpp @@ -206,7 +206,7 @@ ReturnedValue QmlTypeWrapper::get(Managed *m, String *name, bool *hasProperty) if (r.type) { return create(scope.engine, object, r.type, w->d()->mode); } else if (r.scriptIndex != -1) { - QV4::ScopedObject scripts(scope, context->importedScripts); + QV4::ScopedObject scripts(scope, context->importedScripts.valueRef()); return scripts->getIndexed(r.scriptIndex); } else if (r.importNamespace) { return create(scope.engine, object, context->imports, r.importNamespace); @@ -228,7 +228,7 @@ ReturnedValue QmlTypeWrapper::get(Managed *m, String *name, bool *hasProperty) } -void QmlTypeWrapper::put(Managed *m, String *name, const ValueRef value) +void QmlTypeWrapper::put(Managed *m, String *name, const Value &value) { Q_ASSERT(m->as<QmlTypeWrapper>()); QmlTypeWrapper *w = static_cast<QmlTypeWrapper *>(m); diff --git a/src/qml/qml/qqmltypewrapper_p.h b/src/qml/qml/qqmltypewrapper_p.h index 321e0cf0ec..2d2aef2962 100644 --- a/src/qml/qml/qqmltypewrapper_p.h +++ b/src/qml/qml/qqmltypewrapper_p.h @@ -95,7 +95,7 @@ struct Q_QML_EXPORT QmlTypeWrapper : Object static ReturnedValue get(Managed *m, String *name, bool *hasProperty); - static void put(Managed *m, String *name, const ValueRef value); + static void put(Managed *m, String *name, const Value &value); static PropertyAttributes query(const Managed *, String *name); static bool isEqualTo(Managed *that, Managed *o); diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp index 1e138be341..b80472559b 100644 --- a/src/qml/qml/qqmlvaluetypewrapper.cpp +++ b/src/qml/qml/qqmlvaluetypewrapper.cpp @@ -337,7 +337,7 @@ ReturnedValue QQmlValueTypeWrapper::get(Managed *m, String *name, bool *hasPrope #undef VALUE_TYPE_ACCESSOR } -void QQmlValueTypeWrapper::put(Managed *m, String *name, const ValueRef value) +void QQmlValueTypeWrapper::put(Managed *m, String *name, const Value &value) { Q_ASSERT(m->as<QQmlValueTypeWrapper>()); ExecutionEngine *v4 = static_cast<QQmlValueTypeWrapper *>(m)->engine(); @@ -389,7 +389,7 @@ void QQmlValueTypeWrapper::put(Managed *m, String *name, const ValueRef value) cacheData.valueTypeCoreIndex = pd->coreIndex; cacheData.valueTypePropType = property.userType(); - QV4::Scoped<QQmlBindingFunction> bindingFunction(scope, f); + QV4::Scoped<QQmlBindingFunction> bindingFunction(scope, (const Value &)f); bindingFunction->initBindingLocation(); newBinding = new QQmlBinding(value, reference->d()->object, context); diff --git a/src/qml/qml/qqmlvaluetypewrapper_p.h b/src/qml/qml/qqmlvaluetypewrapper_p.h index 2d0fbcbf52..193c353254 100644 --- a/src/qml/qml/qqmlvaluetypewrapper_p.h +++ b/src/qml/qml/qqmlvaluetypewrapper_p.h @@ -88,7 +88,7 @@ public: bool isEqual(const QVariant& value); static ReturnedValue get(Managed *m, String *name, bool *hasProperty); - static void put(Managed *m, String *name, const ValueRef value); + static void put(Managed *m, String *name, const Value &value); static bool isEqualTo(Managed *m, Managed *other); static PropertyAttributes query(const Managed *, String *name); diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index 40ae8ce35a..3c078ea42a 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -1016,7 +1016,7 @@ QVariant QQmlVMEMetaObject::readPropertyAsVariant(int id) } } -void QQmlVMEMetaObject::writeVarProperty(int id, const QV4::ValueRef value) +void QQmlVMEMetaObject::writeVarProperty(int id, const QV4::Value &value) { Q_ASSERT(id >= firstVarPropertyIndex); if (!ensureVarPropertiesAllocated()) @@ -1195,7 +1195,7 @@ QV4::ReturnedValue QQmlVMEMetaObject::vmeProperty(int index) return readVarProperty(index - propOffset()); } -void QQmlVMEMetaObject::setVMEProperty(int index, const QV4::ValueRef v) +void QQmlVMEMetaObject::setVMEProperty(int index, const QV4::Value &v) { if (index < propOffset()) { Q_ASSERT(parentVMEMetaObject()); diff --git a/src/qml/qml/qqmlvmemetaobject_p.h b/src/qml/qml/qqmlvmemetaobject_p.h index a7df7c6e53..b9cdc0a8cd 100644 --- a/src/qml/qml/qqmlvmemetaobject_p.h +++ b/src/qml/qml/qqmlvmemetaobject_p.h @@ -162,7 +162,7 @@ public: quint16 vmeMethodLineNumber(int index); void setVmeMethod(int index, QV4::ValueRef function); QV4::ReturnedValue vmeProperty(int index); - void setVMEProperty(int index, const QV4::ValueRef v); + void setVMEProperty(int index, const QV4::Value &v); void connectAliasSignal(int index, bool indexInSignalRange); @@ -217,7 +217,7 @@ public: QV4::ReturnedValue method(int); QV4::ReturnedValue readVarProperty(int); - void writeVarProperty(int, const QV4::ValueRef); + void writeVarProperty(int, const QV4::Value &); QVariant readPropertyAsVariant(int); void writeProperty(int, const QVariant &); diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 7c4413a500..527e9c8446 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -93,7 +93,7 @@ static inline QQmlXMLHttpRequestData *xhrdata(ExecutionEngine *v4) return (QQmlXMLHttpRequestData *)v4->v8Engine->xmlHttpRequestData(); } -static ReturnedValue constructMeObject(const ValueRef thisObj, ExecutionEngine *v4) +static ReturnedValue constructMeObject(const Value &thisObj, ExecutionEngine *v4) { Scope scope(v4); ScopedObject meObj(scope, v4->newObject()); @@ -1014,9 +1014,9 @@ public: int replyStatus() const; QString replyStatusText() const; - ReturnedValue open(const ValueRef me, const QString &, const QUrl &, LoadType); - ReturnedValue send(const ValueRef me, const QByteArray &); - ReturnedValue abort(const ValueRef me); + ReturnedValue open(const Value &me, const QString &, const QUrl &, LoadType); + ReturnedValue send(const Value &me, const QByteArray &); + ReturnedValue abort(const Value &me); void addHeader(const QString &, const QString &); QString header(const QString &name); @@ -1059,11 +1059,11 @@ private: void readEncoding(); ReturnedValue getMe() const; - void setMe(const ValueRef me); + void setMe(const Value &me); PersistentValue m_me; - void dispatchCallbackImpl(const ValueRef me); - void dispatchCallback(const ValueRef me); + void dispatchCallbackImpl(const Value &me); + void dispatchCallback(const Value &me); int m_status; QString m_statusText; @@ -1113,7 +1113,7 @@ QString QQmlXMLHttpRequest::replyStatusText() const return m_statusText; } -ReturnedValue QQmlXMLHttpRequest::open(const ValueRef me, const QString &method, const QUrl &url, LoadType loadType) +ReturnedValue QQmlXMLHttpRequest::open(const Value &me, const QString &method, const QUrl &url, LoadType loadType) { destroyNetwork(); m_sendFlag = false; @@ -1258,7 +1258,7 @@ void QQmlXMLHttpRequest::requestFromUrl(const QUrl &url) } } -ReturnedValue QQmlXMLHttpRequest::send(const ValueRef me, const QByteArray &data) +ReturnedValue QQmlXMLHttpRequest::send(const Value &me, const QByteArray &data) { m_errorFlag = false; m_sendFlag = true; @@ -1272,7 +1272,7 @@ ReturnedValue QQmlXMLHttpRequest::send(const ValueRef me, const QByteArray &data return Encode::undefined(); } -ReturnedValue QQmlXMLHttpRequest::abort(const ValueRef me) +ReturnedValue QQmlXMLHttpRequest::abort(const Value &me) { destroyNetwork(); m_responseEntityBody = QByteArray(); @@ -1298,7 +1298,7 @@ ReturnedValue QQmlXMLHttpRequest::getMe() const return m_me.value(); } -void QQmlXMLHttpRequest::setMe(const ValueRef me) +void QQmlXMLHttpRequest::setMe(const Value &me) { m_me.set(v4, me); } @@ -1407,7 +1407,7 @@ void QQmlXMLHttpRequest::finished() if (m_state < HeadersReceived) { m_state = HeadersReceived; fillHeadersList (); - dispatchCallback(m_me); + dispatchCallback(*m_me.valueRef()); } m_responseEntityBody.append(m_network->readAll()); readEncoding(); @@ -1424,11 +1424,11 @@ void QQmlXMLHttpRequest::finished() destroyNetwork(); if (m_state < Loading) { m_state = Loading; - dispatchCallback(m_me); + dispatchCallback(*m_me.valueRef()); } m_state = Done; - dispatchCallback(m_me); + dispatchCallback(*m_me.valueRef()); Scope scope(v4); ScopedValue v(scope, Primitive::undefinedValue()); @@ -1510,7 +1510,7 @@ const QByteArray &QQmlXMLHttpRequest::rawResponseBody() const return m_responseEntityBody; } -void QQmlXMLHttpRequest::dispatchCallbackImpl(const ValueRef me) +void QQmlXMLHttpRequest::dispatchCallbackImpl(const Value &me) { QV4::Scope scope(v4); ScopedObject o(scope, me); @@ -1554,7 +1554,7 @@ void QQmlXMLHttpRequest::dispatchCallbackImpl(const ValueRef me) } -void QQmlXMLHttpRequest::dispatchCallback(const ValueRef me) +void QQmlXMLHttpRequest::dispatchCallback(const Value &me) { dispatchCallbackImpl(me); if (v4->hasException) { diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index 73113be9ba..154b3830ef 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -223,7 +223,7 @@ void QV8Engine::initializeGlobal() } } -void QV8Engine::freezeObject(const QV4::ValueRef value) +void QV8Engine::freezeObject(const QV4::Value &value) { QV4::Scope scope(m_v4Engine); QV4::ScopedFunctionObject f(scope, m_freezeObject.value()); diff --git a/src/qml/qml/v8/qv8engine_p.h b/src/qml/qml/v8/qv8engine_p.h index 1d3e427877..25f599ca72 100644 --- a/src/qml/qml/v8/qv8engine_p.h +++ b/src/qml/qml/v8/qv8engine_p.h @@ -130,7 +130,7 @@ private: QQmlV4Function &operator=(const QQmlV4Function &); QQmlV4Function(QV4::CallData *callData, QV4::ValueRef retVal, - const QV4::ValueRef global, QQmlContextData *c, QV4::ExecutionEngine *e) + const QV4::Value &global, QQmlContextData *c, QV4::ExecutionEngine *e) : callData(callData), retVal(retVal), ctx(c), e(e) { callData->thisObject.val = global.asReturnedValue(); @@ -194,7 +194,7 @@ public: QQmlContextData *callingContext(); - void freezeObject(const QV4::ValueRef value); + void freezeObject(const QV4::Value &value); // Return the network access manager for this engine. By default this returns the network // access manager of the QQmlEngine. It is overridden in the case of a threaded v8 |