Flag meta objects generated by QtDBus

QtDBus requires a QVariant argument to be passed to property reads and
writes.  For performance reasons QtDeclarative does not do this.  By
flagging the meta object as requiring this, QtDeclarative can do so only
required.

Task-number: QTBUG-15052

Change-Id: I032c946f079523f5f10217ed56642fb315265d9f
Reviewed-on: http://codereview.qt.nokia.com/2365
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
This commit is contained in:
Aaron Kennedy 2011-07-29 13:03:52 +10:00 committed by Qt by Nokia
parent a2c0390468
commit 78cf553469
2 changed files with 13 additions and 2 deletions

View File

@ -101,7 +101,8 @@ enum MethodFlags {
};
enum MetaObjectFlags {
DynamicMetaObject = 0x01
DynamicMetaObject = 0x01,
RequiresVariantMetaObject = 0x02
};
class QMutex;

View File

@ -125,6 +125,11 @@ private:
MethodScriptable = 0x40
};
enum MetaObjectFlags {
DynamicMetaObject = 0x01,
RequiresVariantMetaObject = 0x02
};
QMap<QByteArray, Method> methods;
QMap<QByteArray, Property> properties;
@ -152,6 +157,8 @@ struct QDBusMetaObjectPrivate
int methodCount, methodData;
int propertyCount, propertyData;
int enumeratorCount, enumeratorData;
int constructorCount, constructorData; // since revision 2
int flags; // since revision 3
// this is specific for QDBusMetaObject:
int propertyDBusData;
@ -416,7 +423,7 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
idata.resize(sizeof(QDBusMetaObjectPrivate) / sizeof(int));
QDBusMetaObjectPrivate *header = reinterpret_cast<QDBusMetaObjectPrivate *>(idata.data());
header->revision = 1;
header->revision = 3;
header->className = 0;
header->classInfoCount = 0;
header->classInfoData = 0;
@ -426,6 +433,9 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
header->propertyData = header->methodData + header->methodCount * 5;
header->enumeratorCount = 0;
header->enumeratorData = 0;
header->constructorCount = 0;
header->constructorData = 0;
header->flags = RequiresVariantMetaObject;
header->propertyDBusData = header->propertyData + header->propertyCount * 3;
header->methodDBusData = header->propertyDBusData + header->propertyCount * intsPerProperty;