diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-01-27 03:49:12 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-01-27 03:49:12 (GMT) |
commit | d9e4393ef212dba9eeba68277b270d68bcdbc733 (patch) | |
tree | d65ff0df673db66478b081d672f3fe383ae6e5a5 /src/declarative/qml/qdeclarativeobjectscriptclass.cpp | |
parent | f15778e60ba538b8715f6433a472ffe08a21d934 (diff) | |
download | Qt-d9e4393ef212dba9eeba68277b270d68bcdbc733.zip Qt-d9e4393ef212dba9eeba68277b270d68bcdbc733.tar.gz Qt-d9e4393ef212dba9eeba68277b270d68bcdbc733.tar.bz2 |
Implement property versioning inside the declarative engine
Task-number: QTBUG-13451
Diffstat (limited to 'src/declarative/qml/qdeclarativeobjectscriptclass.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativeobjectscriptclass.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index 1c2aec9..cbbf2b9 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -149,8 +149,8 @@ QDeclarativeObjectScriptClass::queryProperty(Object *object, const Identifier &n QScriptClass::QueryFlags QDeclarativeObjectScriptClass::queryProperty(QObject *obj, const Identifier &name, - QScriptClass::QueryFlags flags, QDeclarativeContextData *evalContext, - QueryHints hints) + QScriptClass::QueryFlags flags, QDeclarativeContextData *evalContext, + QueryHints hints) { Q_UNUSED(flags); lastData = 0; @@ -165,19 +165,10 @@ QDeclarativeObjectScriptClass::queryProperty(QObject *obj, const Identifier &nam QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine); lastData = QDeclarativePropertyCache::property(engine, obj, name, local); - - if (lastData && lastData->revision > 0 && (hints & ImplicitObject)) { - QDeclarativeData *data = QDeclarativeData::get(obj); - if (data) { - if (!data->type) { - lastData = 0; - } else if (lastData->flags & QDeclarativePropertyCache::Data::IsFunction) { - if (!data->type->isMethodAvailable(lastData->coreIndex, lastData->revision)) - lastData = 0; - } else if (!data->type->isPropertyAvailable(lastData->coreIndex, lastData->revision)) { - lastData = 0; - } - } + if ((hints & ImplicitObject) && lastData && lastData->revision != 0) { + QDeclarativeData *ddata = QDeclarativeData::get(obj); + if (ddata && ddata->propertyCache && !ddata->propertyCache->isAllowedInRevision(lastData)) + return 0; } if (lastData) |