diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-05-25 06:23:27 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-05-25 06:23:27 (GMT) |
commit | a32987d32033a07e5a7440d7928cc8234db144bb (patch) | |
tree | ea46fb9c0f0487b481fe19e28739244636921b4b /src/declarative | |
parent | 8abe00029fddc0f54c2c5afeda488a76182fd95c (diff) | |
download | Qt-a32987d32033a07e5a7440d7928cc8234db144bb.zip Qt-a32987d32033a07e5a7440d7928cc8234db144bb.tar.gz Qt-a32987d32033a07e5a7440d7928cc8234db144bb.tar.bz2 |
Revert "Always pass context to QObject script class"
This reverts commit d982ded10a3dd5219ae40a5a3574b63ac7bdda3f.
Diffstat (limited to 'src/declarative')
4 files changed, 6 insertions, 9 deletions
diff --git a/src/declarative/qml/qdeclarativecontextscriptclass.cpp b/src/declarative/qml/qdeclarativecontextscriptclass.cpp index 03a1f6a..1ebedbb 100644 --- a/src/declarative/qml/qdeclarativecontextscriptclass.cpp +++ b/src/declarative/qml/qdeclarativecontextscriptclass.cpp @@ -270,7 +270,7 @@ QDeclarativeContextScriptClass::property(Object *object, const Identifier &name) if (lastScopeObject) { - return ep->objectClass->property(lastScopeObject, name, context()); + return ep->objectClass->property(lastScopeObject, name); } else if (lastData) { diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index 7c818a6..be2be8b 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -203,14 +203,12 @@ QDeclarativeObjectScriptClass::queryProperty(QObject *obj, const Identifier &nam QDeclarativeObjectScriptClass::Value QDeclarativeObjectScriptClass::property(Object *object, const Identifier &name) { - return property(toQObject(object), name, context()); + return property(toQObject(object), name); } QDeclarativeObjectScriptClass::Value -QDeclarativeObjectScriptClass::property(QObject *obj, const Identifier &name, QScriptContext *context) +QDeclarativeObjectScriptClass::property(QObject *obj, const Identifier &name) { - Q_ASSERT(context); - QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine); if (name == m_destroyId.identifier) @@ -222,7 +220,7 @@ QDeclarativeObjectScriptClass::property(QObject *obj, const Identifier &name, QS if (lastData && !lastData->isValid()) { QString error = QLatin1String("Cannot access non-existent property \"") + toString(name) + QLatin1Char('\"'); - return Value(scriptEngine, context->throwError(error)); + return Value(scriptEngine, context()->throwError(error)); } Q_ASSERT(obj); diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass_p.h b/src/declarative/qml/qdeclarativeobjectscriptclass_p.h index 61fa586..34c71a0 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass_p.h +++ b/src/declarative/qml/qdeclarativeobjectscriptclass_p.h @@ -113,11 +113,10 @@ public: QDeclarativeContextData *evalContext, QueryHints hints = 0); - Value property(QObject *, const Identifier &, QScriptContext *context); + Value property(QObject *, const Identifier &); void setProperty(QObject *, const Identifier &name, const QScriptValue &, QScriptContext *context, QDeclarativeContextData *evalContext = 0); - virtual QStringList propertyNames(Object *); virtual bool compare(Object *, Object *); diff --git a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp index b512387..2a3417a 100644 --- a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp +++ b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp @@ -147,7 +147,7 @@ QDeclarativeTypeNameScriptClass::property(Object *obj, const Identifier &name) if (type) { return Value(scriptEngine, newObject(((TypeNameData *)obj)->object, type, ((TypeNameData *)obj)->mode)); } else if (object) { - return ep->objectClass->property(object, name, context()); + return ep->objectClass->property(object, name); } else { return Value(scriptEngine, enumValue); } |