From 78cf553469bbfc0a5b4952d54ffe96566cae266c Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 29 Jul 2011 13:03:52 +1000 Subject: [PATCH] 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 Reviewed-by: Martin Jones --- src/corelib/kernel/qmetaobject_p.h | 3 ++- src/dbus/qdbusmetaobject.cpp | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index 63605ec..5da936a 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -101,7 +101,8 @@ enum MethodFlags { }; enum MetaObjectFlags { - DynamicMetaObject = 0x01 + DynamicMetaObject = 0x01, + RequiresVariantMetaObject = 0x02 }; class QMutex; diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp index d12642d..8daf230 100644 --- a/src/dbus/qdbusmetaobject.cpp +++ b/src/dbus/qdbusmetaobject.cpp @@ -125,6 +125,11 @@ private: MethodScriptable = 0x40 }; + enum MetaObjectFlags { + DynamicMetaObject = 0x01, + RequiresVariantMetaObject = 0x02 + }; + QMap methods; QMap 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(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; -- 2.7.4