diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2013-09-19 12:12:22 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 16:21:40 +0200 |
commit | deccc5f146c38d5bafe4b608c30a28602ef20f6d (patch) | |
tree | 1041201d811c33c4d12d179bf586a4212fa01bfe | |
parent | e0256ec27512437421d8a63d9090e478b87af599 (diff) |
Make compile after recent V4 API changes
Change-Id: Ib14d670e51c256d52ad6c62a6091b470ed3c95e7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
5 files changed, 24 insertions, 18 deletions
diff --git a/src/imports/location/qdeclarativegeoroute.cpp b/src/imports/location/qdeclarativegeoroute.cpp index 3430a2b9..f1135f56 100644 --- a/src/imports/location/qdeclarativegeoroute.cpp +++ b/src/imports/location/qdeclarativegeoroute.cpp @@ -170,17 +170,18 @@ QJSValue QDeclarativeGeoRoute::path() const QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(engine); QV4::ExecutionEngine *v4 = QV8Engine::getV4(v8Engine); - QV4::ArrayObject *pathArray = v4->newArrayObject(route_.path().length()); + QV4::Scope scope(v4); + QV4::Scoped<QV4::ArrayObject> pathArray(scope, v4->newArrayObject(route_.path().length())); for (int i = 0; i < route_.path().length(); ++i) { const QGeoCoordinate &c = route_.path().at(i); QQmlValueType *vt = QQmlValueTypeFactory::valueType(qMetaTypeId<QGeoCoordinate>()); - QV4::Value cv = QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt); + QV4::ScopedValue cv(scope, QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt)); pathArray->putIndexed(i, cv); } - return new QJSValuePrivate(pathArray); + return new QJSValuePrivate(v4, pathArray.asValue()); } void QDeclarativeGeoRoute::setPath(const QJSValue &value) diff --git a/src/imports/location/qdeclarativegeoroutemodel.cpp b/src/imports/location/qdeclarativegeoroutemodel.cpp index 9ace5174..92c681f2 100644 --- a/src/imports/location/qdeclarativegeoroutemodel.cpp +++ b/src/imports/location/qdeclarativegeoroutemodel.cpp @@ -735,17 +735,18 @@ QJSValue QDeclarativeGeoRouteQuery::waypoints() QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(engine); QV4::ExecutionEngine *v4 = QV8Engine::getV4(v8Engine); - QV4::ArrayObject *waypointArray = v4->newArrayObject(request_.waypoints().length()); + QV4::Scope scope(v4); + QV4::Scoped<QV4::ArrayObject> waypointArray(scope, v4->newArrayObject(request_.waypoints().length())); for (int i = 0; i < request_.waypoints().length(); ++i) { const QGeoCoordinate &c = request_.waypoints().at(i); QQmlValueType *vt = QQmlValueTypeFactory::valueType(qMetaTypeId<QGeoCoordinate>()); - QV4::Value cv = QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt); + QV4::ScopedValue cv(scope, QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt)); waypointArray->putIndexed(i, cv); } - return new QJSValuePrivate(waypointArray); + return new QJSValuePrivate(v4, waypointArray.asValue()); } void QDeclarativeGeoRouteQuery::setWaypoints(const QJSValue &value) @@ -793,17 +794,18 @@ QJSValue QDeclarativeGeoRouteQuery::excludedAreas() const QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(engine); QV4::ExecutionEngine *v4 = QV8Engine::getV4(v8Engine); - QV4::ArrayObject *excludedAreasArray = v4->newArrayObject(request_.excludeAreas().length()); + QV4::Scope scope(v4); + QV4::Scoped<QV4::ArrayObject> excludedAreasArray(scope, v4->newArrayObject(request_.excludeAreas().length())); for (int i = 0; i < request_.excludeAreas().length(); ++i) { const QGeoRectangle &r = request_.excludeAreas().at(i); QQmlValueType *vt = QQmlValueTypeFactory::valueType(qMetaTypeId<QGeoRectangle>()); - QV4::Value cv = QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(r), vt); + QV4::ScopedValue cv(scope, QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(r), vt)); excludedAreasArray->putIndexed(i, cv); } - return new QJSValuePrivate(excludedAreasArray); + return new QJSValuePrivate(v4, excludedAreasArray.asValue()); } void QDeclarativeGeoRouteQuery::setExcludedAreas(const QJSValue &value) diff --git a/src/imports/location/qdeclarativegeoroutesegment.cpp b/src/imports/location/qdeclarativegeoroutesegment.cpp index 3dbe06f8..d51c2c98 100644 --- a/src/imports/location/qdeclarativegeoroutesegment.cpp +++ b/src/imports/location/qdeclarativegeoroutesegment.cpp @@ -156,17 +156,18 @@ QJSValue QDeclarativeGeoRouteSegment::path() const QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(engine); QV4::ExecutionEngine *v4 = QV8Engine::getV4(v8Engine); - QV4::ArrayObject *pathArray = v4->newArrayObject(segment_.path().length()); + QV4::Scope scope(v4); + QV4::Scoped<QV4::ArrayObject> pathArray(scope, v4->newArrayObject(segment_.path().length())); for (int i = 0; i < segment_.path().length(); ++i) { const QGeoCoordinate &c = segment_.path().at(i); QQmlValueType *vt = QQmlValueTypeFactory::valueType(qMetaTypeId<QGeoCoordinate>()); - QV4::Value cv = QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt); + QV4::ScopedValue cv(scope, QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt)); pathArray->putIndexed(i, cv); } - return new QJSValuePrivate(pathArray); + return new QJSValuePrivate(v4, pathArray.asValue()); } #include "moc_qdeclarativegeoroutesegment_p.cpp" diff --git a/src/imports/location/qdeclarativepolygonmapitem.cpp b/src/imports/location/qdeclarativepolygonmapitem.cpp index b1e43397..bd67a82a 100644 --- a/src/imports/location/qdeclarativepolygonmapitem.cpp +++ b/src/imports/location/qdeclarativepolygonmapitem.cpp @@ -390,17 +390,18 @@ QJSValue QDeclarativePolygonMapItem::path() const QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(engine); QV4::ExecutionEngine *v4 = QV8Engine::getV4(v8Engine); - QV4::ArrayObject *pathArray = v4->newArrayObject(path_.length()); + QV4::Scope scope(v4); + QV4::Scoped<QV4::ArrayObject> pathArray(scope, v4->newArrayObject(path_.length())); for (int i = 0; i < path_.length(); ++i) { const QGeoCoordinate &c = path_.at(i); QQmlValueType *vt = QQmlValueTypeFactory::valueType(qMetaTypeId<QGeoCoordinate>()); - QV4::Value cv = QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt); + QV4::ScopedValue cv(scope, QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt)); pathArray->putIndexed(i, cv); } - return new QJSValuePrivate(pathArray); + return new QJSValuePrivate(v4, pathArray.asValue()); } void QDeclarativePolygonMapItem::setPath(const QJSValue &value) diff --git a/src/imports/location/qdeclarativepolylinemapitem.cpp b/src/imports/location/qdeclarativepolylinemapitem.cpp index 23713561..d1a190a6 100644 --- a/src/imports/location/qdeclarativepolylinemapitem.cpp +++ b/src/imports/location/qdeclarativepolylinemapitem.cpp @@ -501,17 +501,18 @@ QJSValue QDeclarativePolylineMapItem::path() const QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(engine); QV4::ExecutionEngine *v4 = QV8Engine::getV4(v8Engine); - QV4::ArrayObject *pathArray = v4->newArrayObject(path_.length()); + QV4::Scope scope(v4); + QV4::Scoped<QV4::ArrayObject> pathArray(scope, v4->newArrayObject(path_.length())); for (int i = 0; i < path_.length(); ++i) { const QGeoCoordinate &c = path_.at(i); QQmlValueType *vt = QQmlValueTypeFactory::valueType(qMetaTypeId<QGeoCoordinate>()); - QV4::Value cv = QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt); + QV4::ScopedValue cv(scope, QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt)); pathArray->putIndexed(i, cv); } - return new QJSValuePrivate(pathArray); + return new QJSValuePrivate(v4, pathArray.asValue()); } void QDeclarativePolylineMapItem::setPath(const QJSValue &value) |