summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-07-29 13:03:52 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-29 05:19:47 +0200
commit78cf553469bbfc0a5b4952d54ffe96566cae266c (patch)
tree5144075340dcb3b848dd87da5779c23aa824b5c0
parenta2c0390468b91a3f8a97a3bbabc2f9c98e0d105a (diff)
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>
-rw-r--r--src/corelib/kernel/qmetaobject_p.h3
-rw-r--r--src/dbus/qdbusmetaobject.cpp12
2 files changed, 13 insertions, 2 deletions
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index 63605ecadb..5da936aab0 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 d12642d632..8daf2300b7 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<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;