summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-01-28 02:00:21 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2011-01-28 02:00:21 (GMT)
commitcb6b9ee680f792750d0cb265ea59ff3ff4643562 (patch)
tree4c735bd8cde722945b893b4aad389daca709254c /src
parent547e2162c872ca5707f5bc54d06b3c39c9bd6477 (diff)
downloadQt-cb6b9ee680f792750d0cb265ea59ff3ff4643562.zip
Qt-cb6b9ee680f792750d0cb265ea59ff3ff4643562.tar.gz
Qt-cb6b9ee680f792750d0cb265ea59ff3ff4643562.tar.bz2
Ensure simple objects also get the appropriate property cache
Task-number: QTBUG-13849
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativedata_p.h5
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp3
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp12
3 files changed, 9 insertions, 11 deletions
diff --git a/src/declarative/qml/qdeclarativedata_p.h b/src/declarative/qml/qdeclarativedata_p.h
index f0ff0c0..33458dc 100644
--- a/src/declarative/qml/qdeclarativedata_p.h
+++ b/src/declarative/qml/qdeclarativedata_p.h
@@ -66,7 +66,6 @@ class QDeclarativePropertyCache;
class QDeclarativeContextData;
class QDeclarativeNotifier;
class QDeclarativeDataExtended;
-class QDeclarativeType;
// This class is structured in such a way, that simply zero'ing it is the
// default state for elemental object allocations. This is crucial in the
// workings of the QDeclarativeInstruction::CreateSimpleObject instruction.
@@ -78,7 +77,7 @@ public:
: ownMemory(true), ownContext(false), indestructible(true), explicitIndestructibleSet(false),
context(0), outerContext(0), bindings(0), nextContextObject(0), prevContextObject(0), bindingBitsSize(0),
bindingBits(0), lineNumber(0), columnNumber(0), deferredComponent(0), deferredIdx(0),
- scriptValue(0), objectDataRefCount(0), propertyCache(0), guards(0), type(0), extendedData(0) {
+ scriptValue(0), objectDataRefCount(0), propertyCache(0), guards(0), extendedData(0) {
init();
}
@@ -137,8 +136,6 @@ public:
QDeclarativeGuard<QObject> *guards;
- const QDeclarativeType *type;
-
static QDeclarativeData *get(const QObject *object, bool create = false) {
QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
if (priv->wasDeleted) {
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index 7701a23..ee47d0b 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -166,8 +166,9 @@ QDeclarativeObjectScriptClass::queryProperty(QObject *obj, const Identifier &nam
QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine);
lastData = QDeclarativePropertyCache::property(engine, obj, name, local);
if ((hints & ImplicitObject) && lastData && lastData->revision != 0) {
+
QDeclarativeData *ddata = QDeclarativeData::get(obj);
- if (ddata && ddata->propertyCache && !ddata->propertyCache->isAllowedInRevision(lastData))
+ if (ddata && ddata->propertyCache && !ddata->propertyCache->isAllowedInRevision(lastData))
return 0;
}
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp
index 657b10d..366c64b 100644
--- a/src/declarative/qml/qdeclarativevme.cpp
+++ b/src/declarative/qml/qdeclarativevme.cpp
@@ -194,8 +194,6 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
QDeclarativeData *ddata = QDeclarativeData::get(o);
Q_ASSERT(ddata);
- if (types.at(instr.create.type).type)
- ddata->type = types.at(instr.create.type).type;
if (stack.isEmpty()) {
if (ddata->context) {
@@ -249,10 +247,12 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
::memset(o, 0, instr.createSimple.typeSize + sizeof(QDeclarativeData));
instr.createSimple.create(o);
- QDeclarativeData *ddata =
- (QDeclarativeData *)(((const char *)o) + instr.createSimple.typeSize);
- if (types.at(instr.createSimple.type).type)
- ddata->type = types.at(instr.createSimple.type).type;
+ QDeclarativeData *ddata = (QDeclarativeData *)(((const char *)o) + instr.createSimple.typeSize);
+ const QDeclarativeCompiledData::TypeReference &ref = types.at(instr.createSimple.type);
+ if (!ddata->propertyCache && ref.typePropertyCache) {
+ ddata->propertyCache = ref.typePropertyCache;
+ ddata->propertyCache->addref();
+ }
ddata->lineNumber = instr.line;
ddata->columnNumber = instr.createSimple.column;