summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetaobjectbuilder.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2012-01-12 22:34:44 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-13 05:57:39 +0100
commit56b2a229a392befd23c6ff48d0c1af8605075d31 (patch)
tree8632bdc7f97dd2b85be5bedee8e2dadc9c691e8f /src/corelib/kernel/qmetaobjectbuilder.cpp
parent0528d9dca7ec14e39bcae93c975069a517954e2e (diff)
Remove the Q_NO_DATA_RELOCATION hack
This hack was there because symbian used to have a problem with relocations in the data section, between libraries. Hence, this was needed so the metaobject could have a pointer to the base metaobject, despite being in another library. Anyway, I was told that symbian was fixed eventually. but the hack had to stay there because of compatibility. But now that we don't even support symbian, we can get rid of this hack totally. Change-Id: I7249971ece35d952efa92bf8b04bf3aa3667624c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qmetaobjectbuilder.cpp')
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp
index 69cb25a6c5..601d52529f 100644
--- a/src/corelib/kernel/qmetaobjectbuilder.cpp
+++ b/src/corelib/kernel/qmetaobjectbuilder.cpp
@@ -265,11 +265,7 @@ 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;
};
@@ -695,11 +691,7 @@ 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();
@@ -772,14 +764,10 @@ 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
-#endif
{
const QMetaObjectExtraData *extra = (const QMetaObjectExtraData *)(prototype->d.extradata);
if (extra)
@@ -871,11 +859,7 @@ 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;
}
@@ -1414,13 +1398,8 @@ 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;
@@ -1619,14 +1598,10 @@ 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
@@ -1799,9 +1774,6 @@ 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;
@@ -1813,7 +1785,6 @@ void QMetaObjectBuilder::deserialize
}
addRelatedMetaObject(cl);
}
-#endif
// Read the extra data block, which is reserved for future use.
stream >> name;