Smaller cleanups
authorLars Knoll <lars.knoll@theqtcompany.com>
Mon, 22 Jun 2015 16:30:06 +0000 (18:30 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Fri, 14 Aug 2015 11:49:51 +0000 (11:49 +0000)
Change-Id: I14eb7e2b4031c8a033740ed1ef34f3b2efdc3649
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
src/qml/jsruntime/qv4context.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/qml/qqmlcontextwrapper.cpp

index 667ea70..f50c5ab 100644 (file)
@@ -549,3 +549,14 @@ Heap::FunctionObject *ExecutionContext::getFunctionObject() const
 
     return 0;
 }
+
+
+QObject *QmlContext::qmlScope() const
+{
+    return d()->qml->scopeObject;
+}
+
+QQmlContextData *QmlContext::qmlContext() const
+{
+    return d()->qml->context;
+}
index 1e051ed..2667bbe 100644 (file)
@@ -38,6 +38,9 @@
 
 QT_BEGIN_NAMESPACE
 
+class QQmlContextData;
+class QObject;
+
 namespace QV4 {
 
 namespace CompiledData {
@@ -218,6 +221,9 @@ struct WithContext : public ExecutionContext
 struct QmlContext : public ExecutionContext
 {
     V4_MANAGED(QmlContext, ExecutionContext)
+
+    QObject *qmlScope() const;
+    QQmlContextData *qmlContext() const;
 };
 
 inline CallContext *ExecutionContext::asCallContext()
index 02e4e8c..23084fb 100644 (file)
@@ -336,8 +336,8 @@ void QmlContextWrapper::registerQmlDependencies(ExecutionEngine *engine, const C
         return;
 
     QV4::Scope scope(engine);
-    QV4::Scoped<QmlContextWrapper> contextWrapper(scope, engine->qmlContextObject());
-    QQmlContextData *qmlContext = contextWrapper->getContext();
+    QV4::Scoped<QmlContext> context(scope, engine->qmlContext());
+    QQmlContextData *qmlContext = context->qmlContext();
 
     const quint32 *idObjectDependency = compiledFunction->qmlIdObjectDependencyTable();
     const int idObjectDependencyCount = compiledFunction->nDependingIdObjects;
@@ -355,7 +355,7 @@ void QmlContextWrapper::registerQmlDependencies(ExecutionEngine *engine, const C
         capture->captureProperty(qmlContext->contextObject, propertyIndex, notifyIndex);
     }
 
-    QObject *scopeObject = contextWrapper->getScopeObject();
+    QObject *scopeObject = context->qmlScope();
     const quint32 *scopePropertyDependency = compiledFunction->qmlScopePropertiesDependencyTable();
     const int scopePropertyDependencyCount = compiledFunction->nDependingScopeProperties;
     for (int i = 0; i < scopePropertyDependencyCount; ++i) {