summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-09-15 06:23:30 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-09-15 06:23:30 (GMT)
commit8cad28ef7abf92cab034ae3586e24cd0b8be38a2 (patch)
treefb0df99424689a9b7dd4f25562ded7863f6e82cc /src/declarative/qml
parentf6c08f5e68c90338a8402c0912cd6be72e84b1e6 (diff)
downloadQt-8cad28ef7abf92cab034ae3586e24cd0b8be38a2.zip
Qt-8cad28ef7abf92cab034ae3586e24cd0b8be38a2.tar.gz
Qt-8cad28ef7abf92cab034ae3586e24cd0b8be38a2.tar.bz2
Build on S60.
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qmetaobjectbuilder.cpp32
-rw-r--r--src/declarative/qml/qmetaobjectbuilder_p.h6
2 files changed, 36 insertions, 2 deletions
diff --git a/src/declarative/qml/qmetaobjectbuilder.cpp b/src/declarative/qml/qmetaobjectbuilder.cpp
index 58ee454..e7a7591 100644
--- a/src/declarative/qml/qmetaobjectbuilder.cpp
+++ b/src/declarative/qml/qmetaobjectbuilder.cpp
@@ -264,7 +264,11 @@ public:
QList<QByteArray> classInfoNames;
QList<QByteArray> classInfoValues;
QList<QMetaEnumBuilderPrivate> enumerators;
+#ifdef Q_NO_DATA_RELOCATION
+ QList<QMetaObjectAccessor> relatedMetaObjects;
+#else
QList<const QMetaObject *> relatedMetaObjects;
+#endif
int flags;
};
@@ -688,7 +692,11 @@ int QMetaObjectBuilder::addClassInfo(const QByteArray& name, const QByteArray& v
\sa relatedMetaObjectCount(), relatedMetaObject()
\sa removeRelatedMetaObject()
*/
+#ifdef Q_NO_DATA_RELOCATION
+int QMetaObjectBuilder::addRelatedMetaObject(const QMetaObjectAccessor &meta)
+#else
int QMetaObjectBuilder::addRelatedMetaObject(const QMetaObject *meta)
+#endif
{
Q_ASSERT(meta);
int index = d->relatedMetaObjects.size();
@@ -761,10 +769,15 @@ void QMetaObjectBuilder::addMetaObject
}
if ((members & RelatedMetaObjects) != 0) {
+#ifdef Q_NO_DATA_RELOCATION
+ const QMetaObjectAccessor *objects = 0;
+#else
const QMetaObject **objects;
if (priv(prototype->d.data)->revision < 2) {
objects = (const QMetaObject **)(prototype->d.extradata);
- } else {
+ } else
+#endif
+ {
const QMetaObjectExtraData *extra = (const QMetaObjectExtraData *)(prototype->d.extradata);
if (extra)
objects = extra->objects;
@@ -855,7 +868,11 @@ QMetaEnumBuilder QMetaObjectBuilder::enumerator(int index) const
const QMetaObject *QMetaObjectBuilder::relatedMetaObject(int index) const
{
if (index >= 0 && index < d->relatedMetaObjects.size())
+#ifdef Q_NO_DATA_RELOCATION
+ return &((*(d->relatedMetaObjects[index]))());
+#else
return d->relatedMetaObjects[index];
+#endif
else
return 0;
}
@@ -1390,8 +1407,13 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
reinterpret_cast<QMetaObjectExtraData *>(buf + size);
size += sizeof(QMetaObjectExtraData);
ALIGN(size, QMetaObject *);
+#ifdef Q_NO_DATA_RELOCATION
+ QMetaObjectAccessor *objects =
+ reinterpret_cast<QMetaObjectAccessor *>(buf + size);
+#else
const QMetaObject **objects =
reinterpret_cast<const QMetaObject **>(buf + size);
+#endif
if (buf) {
if (d->relatedMetaObjects.size() > 0) {
extra->objects = objects;
@@ -1588,10 +1610,14 @@ void QMetaObjectBuilder::serialize(QDataStream& stream) const
}
// Write the related meta objects.
+#ifdef Q_NO_DATA_RELOCATION
+ //### What do we do here?
+#else
for (index = 0; index < d->relatedMetaObjects.size(); ++index) {
const QMetaObject *meta = d->relatedMetaObjects[index];
stream << QByteArray(meta->className());
}
+#endif
// Add an extra empty QByteArray for additional data in future versions.
// This should help maintain backwards compatibility, allowing older
@@ -1764,6 +1790,9 @@ void QMetaObjectBuilder::deserialize
}
// Read the related meta objects.
+#ifdef Q_NO_DATA_RELOCATION
+ //### What do we do here
+#else
for (index = 0; index < relatedMetaObjectCount; ++index) {
if (stream.status() != QDataStream::Ok)
return;
@@ -1775,6 +1804,7 @@ void QMetaObjectBuilder::deserialize
}
addRelatedMetaObject(cl);
}
+#endif
// Read the extra data block, which is reserved for future use.
stream >> name;
diff --git a/src/declarative/qml/qmetaobjectbuilder_p.h b/src/declarative/qml/qmetaobjectbuilder_p.h
index d503163..18277aa 100644
--- a/src/declarative/qml/qmetaobjectbuilder_p.h
+++ b/src/declarative/qml/qmetaobjectbuilder_p.h
@@ -135,7 +135,11 @@ public:
int addClassInfo(const QByteArray& name, const QByteArray& value);
+#ifdef Q_NO_DATA_RELOCATION
+ int addRelatedMetaObject(const QMetaObjectAccessor &meta);
+#else
int addRelatedMetaObject(const QMetaObject *meta);
+#endif
void addMetaObject(const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members = AllMembers);
@@ -180,7 +184,7 @@ public:
#endif
private:
- Q_DISABLE_COPY(QMetaObjectBuilder);
+ Q_DISABLE_COPY(QMetaObjectBuilder)
QMetaObjectBuilderPrivate *d;