diff options
Diffstat (limited to 'src/dbus')
-rw-r--r-- | src/dbus/qdbusabstractadaptor.cpp | 61 | ||||
-rw-r--r-- | src/dbus/qdbusabstractinterface.cpp | 2 | ||||
-rw-r--r-- | src/dbus/qdbusintegrator.cpp | 8 | ||||
-rw-r--r-- | src/dbus/qdbusinterface.cpp | 2 | ||||
-rw-r--r-- | src/dbus/qdbusmetaobject.cpp | 205 | ||||
-rw-r--r-- | src/dbus/qdbusmetaobject_p.h | 3 | ||||
-rw-r--r-- | src/dbus/qdbusmetatype.cpp | 4 | ||||
-rw-r--r-- | src/dbus/qdbusmisc.cpp | 10 | ||||
-rw-r--r-- | src/dbus/qdbusxmlgenerator.cpp | 2 |
9 files changed, 174 insertions, 123 deletions
diff --git a/src/dbus/qdbusabstractadaptor.cpp b/src/dbus/qdbusabstractadaptor.cpp index 7bdd947a37..bacf93bac8 100644 --- a/src/dbus/qdbusabstractadaptor.cpp +++ b/src/dbus/qdbusabstractadaptor.cpp @@ -181,7 +181,7 @@ void QDBusAbstractAdaptor::setAutoRelaySignals(bool enable) continue; // try to connect/disconnect to a signal on the parent that has the same method signature - QByteArray sig = QMetaObject::normalizedSignature(mm.signature()); + QByteArray sig = QMetaObject::normalizedSignature(mm.methodSignature().constData()); if (them->indexOfSignal(sig) == -1) continue; sig.prepend(QSIGNAL_CODE + '0'); @@ -307,7 +307,7 @@ void QDBusAdaptorConnector::relay(QObject *senderObj, int lastSignalIdx, void ** // invalid signal signature // qDBusParametersForMethod has not yet complained about this one qWarning("QDBusAbstractAdaptor: Cannot relay signal %s::%s", - senderMetaObject->className(), mm.signature()); + senderMetaObject->className(), mm.methodSignature().constData()); return; } @@ -323,10 +323,38 @@ void QDBusAdaptorConnector::relay(QObject *senderObj, int lastSignalIdx, void ** // modify carefully: this has been hand-edited! // the relaySlot slot gets called with the void** array +struct qt_meta_stringdata_QDBusAdaptorConnector_t { + QByteArrayData data[10]; + char stringdata[96]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) { \ + Q_REFCOUNT_INITIALIZE_STATIC, len, 0, 0, \ + offsetof(qt_meta_stringdata_QDBusAdaptorConnector_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + } +static const qt_meta_stringdata_QDBusAdaptorConnector_t qt_meta_stringdata_QDBusAdaptorConnector = { + { +QT_MOC_LITERAL(0, 0, 21), +QT_MOC_LITERAL(1, 22, 11), +QT_MOC_LITERAL(2, 34, 0), +QT_MOC_LITERAL(3, 35, 3), +QT_MOC_LITERAL(4, 39, 18), +QT_MOC_LITERAL(5, 58, 10), +QT_MOC_LITERAL(6, 69, 3), +QT_MOC_LITERAL(7, 73, 4), +QT_MOC_LITERAL(8, 78, 9), +QT_MOC_LITERAL(9, 88, 6) + }, + "QDBusAdaptorConnector\0relaySignal\0\0" + "obj\0const QMetaObject*\0metaObject\0sid\0" + "args\0relaySlot\0polish\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_QDBusAdaptorConnector[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 3, 14, // methods @@ -336,20 +364,21 @@ static const uint qt_meta_data_QDBusAdaptorConnector[] = { 0, // flags 1, // signalCount - // signals: signature, parameters, type, tag, flags - 47, 23, 22, 22, 0x05, + // signals: name, argc, parameters, tag, flags + 1, 4, 29, 2, 0x05, - // slots: signature, parameters, type, tag, flags - 105, 22, 22, 22, 0x0a, - 117, 22, 22, 22, 0x0a, + // slots: name, argc, parameters, tag, flags + 8, 0, 38, 2, 0x0a, + 9, 0, 39, 2, 0x0a, - 0 // eod -}; + // signals: parameters + QMetaType::Void, QMetaType::QObjectStar, 0x80000000 | 4, QMetaType::Int, QMetaType::QVariantList, 3, 5, 6, 7, -static const char qt_meta_stringdata_QDBusAdaptorConnector[] = { - "QDBusAdaptorConnector\0\0obj,metaObject,sid,args\0" - "relaySignal(QObject*,const QMetaObject*,int,QVariantList)\0" - "relaySlot()\0polish()\0" + // slots: parameters + QMetaType::Void, + QMetaType::Void, + + 0 // eod }; void QDBusAdaptorConnector::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) @@ -371,7 +400,7 @@ const QMetaObjectExtraData QDBusAdaptorConnector::staticMetaObjectExtraData = { }; const QMetaObject QDBusAdaptorConnector::staticMetaObject = { - { &QObject::staticMetaObject, qt_meta_stringdata_QDBusAdaptorConnector, + { &QObject::staticMetaObject, qt_meta_stringdata_QDBusAdaptorConnector.data, qt_meta_data_QDBusAdaptorConnector, &staticMetaObjectExtraData } }; @@ -383,7 +412,7 @@ const QMetaObject *QDBusAdaptorConnector::metaObject() const void *QDBusAdaptorConnector::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_QDBusAdaptorConnector)) + if (!strcmp(_clname, qt_meta_stringdata_QDBusAdaptorConnector.stringdata)) return static_cast<void*>(const_cast< QDBusAdaptorConnector*>(this)); return QObject::qt_metacast(_clname); } diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index eeaf0b13eb..cb9f2e7360 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -446,7 +446,7 @@ QDBusMessage QDBusAbstractInterface::callWithArgumentList(QDBus::CallMode mode, for (int i = staticMetaObject.methodCount(); i < mo->methodCount(); ++i) { QMetaMethod mm = mo->method(i); - if (QByteArray(mm.signature()).startsWith(match)) { + if (mm.methodSignature().startsWith(match)) { // found a method with the same name as what we're looking for // hopefully, nobody is overloading asynchronous and synchronous methods with // the same name diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index f0c8224be2..8d46ee4801 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -640,7 +640,7 @@ static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags, continue; // check name: - QByteArray slotname = mm.signature(); + QByteArray slotname = mm.methodSignature(); int paren = slotname.indexOf('('); if (paren != name.length() || !slotname.startsWith(name)) continue; @@ -686,7 +686,7 @@ static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags, ++i; // make sure that the output parameters have signatures too - if (returnType != 0 && QDBusMetaType::typeToSignature(returnType) == 0) + if (returnType != QMetaType::UnknownType && returnType != QMetaType::Void && QDBusMetaType::typeToSignature(returnType) == 0) continue; bool ok = true; @@ -919,7 +919,7 @@ void QDBusConnectionPrivate::deliverCall(QObject *object, int /*flags*/, const Q // output arguments QVariantList outputArgs; void *null = 0; - if (metaTypes[0] != QMetaType::Void) { + if (metaTypes[0] != QMetaType::Void && metaTypes[0] != QMetaType::UnknownType) { QVariant arg(metaTypes[0], null); outputArgs.append( arg ); params[0] = const_cast<void*>(outputArgs.at( outputArgs.count() - 1 ).constData()); @@ -1188,7 +1188,7 @@ void QDBusConnectionPrivate::relaySignal(QObject *obj, const QMetaObject *mo, in QString interface = qDBusInterfaceFromMetaObject(mo); QMetaMethod mm = mo->method(signalId); - QByteArray memberName = mm.signature(); + QByteArray memberName = mm.methodSignature(); memberName.truncate(memberName.indexOf('(')); // check if it's scriptable diff --git a/src/dbus/qdbusinterface.cpp b/src/dbus/qdbusinterface.cpp index d390f395ee..b76dd733a2 100644 --- a/src/dbus/qdbusinterface.cpp +++ b/src/dbus/qdbusinterface.cpp @@ -280,7 +280,7 @@ int QDBusInterfacePrivate::metacall(QMetaObject::Call c, int id, void **argv) } else if (mm.methodType() == QMetaMethod::Slot || mm.methodType() == QMetaMethod::Method) { // method call relay from Qt world to D-Bus world // get D-Bus equivalent signature - QString methodName = QLatin1String(metaObject->dbusNameForMethod(id)); + QString methodName = QString::fromLatin1(mm.name()); const int *inputTypes = metaObject->inputTypesForMethod(id); int inputTypesCount = *inputTypes; diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp index bd7b83bf65..ce8146f639 100644 --- a/src/dbus/qdbusmetaobject.cpp +++ b/src/dbus/qdbusmetaobject.cpp @@ -54,6 +54,7 @@ #include "qdbusabstractinterface_p.h" #include <private/qmetaobject_p.h> +#include <private/qmetaobjectbuilder_p.h> #ifndef QT_NO_DBUS @@ -69,8 +70,7 @@ public: private: struct Method { - QByteArray parameters; - QByteArray typeName; + QList<QByteArray> parameterNames; QByteArray tag; QByteArray name; QVarLengthArray<int, 4> inputTypes; @@ -103,10 +103,12 @@ private: void parseMethods(); void parseSignals(); void parseProperties(); + + static int aggregateParameterCount(const QMap<QByteArray, Method> &map); }; static const int intsPerProperty = 2; -static const int intsPerMethod = 3; +static const int intsPerMethod = 2; struct QDBusMetaObjectPrivate : public QMetaObjectPrivate { @@ -132,6 +134,30 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature, const QDBusIntrospection::Annotations &annotations, const char *direction, int id) { + struct QDBusRawTypeHandler { + static void destroy(void *) + { + qFatal("Cannot destroy placeholder type QDBusRawType"); + } + + static void *create(const void *) + { + qFatal("Cannot create placeholder type QDBusRawType"); + return 0; + } + + static void destruct(void *) + { + qFatal("Cannot destruct placeholder type QDBusRawType"); + } + + static void *construct(void *, const void *) + { + qFatal("Cannot construct placeholder type QDBusRawType"); + return 0; + } + }; + Type result; result.id = QVariant::Invalid; @@ -157,8 +183,13 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature, if (type == QVariant::Invalid || signature != QDBusMetaType::typeToSignature(type)) { // type is still unknown or doesn't match back to the signature that it // was expected to, so synthesize a fake type - type = QMetaType::VoidStar; typeName = "QDBusRawType<0x" + signature.toHex() + ">*"; + type = QMetaType::registerType(typeName, QDBusRawTypeHandler::destroy, + QDBusRawTypeHandler::create, + QDBusRawTypeHandler::destruct, + QDBusRawTypeHandler::construct, + sizeof(void *), + QMetaType::MovableType); } result.name = typeName; @@ -215,8 +246,7 @@ void QDBusMetaObjectGenerator::parseMethods() mm.inputTypes.append(type.id); - mm.parameters.append(arg.name.toLatin1()); - mm.parameters.append(','); + mm.parameterNames.append(arg.name.toLatin1()); prototype.append(type.name); prototype.append(','); @@ -235,13 +265,9 @@ void QDBusMetaObjectGenerator::parseMethods() mm.outputTypes.append(type.id); - if (i == 0) { - // return value - mm.typeName = type.name; - } else { + if (i != 0) { // non-const ref parameter - mm.parameters.append(arg.name.toLatin1()); - mm.parameters.append(','); + mm.parameterNames.append(arg.name.toLatin1()); prototype.append(type.name); prototype.append("&,"); @@ -250,12 +276,10 @@ void QDBusMetaObjectGenerator::parseMethods() if (!ok) continue; // convert the last commas: - if (!mm.parameters.isEmpty()) { - mm.parameters.truncate(mm.parameters.length() - 1); + if (!mm.parameterNames.isEmpty()) prototype[prototype.length() - 1] = ')'; - } else { + else prototype.append(')'); - } // check the async tag if (m.annotations.value(QLatin1String(ANNOTATION_NO_WAIT)) == QLatin1String("true")) @@ -295,8 +319,7 @@ void QDBusMetaObjectGenerator::parseSignals() mm.inputTypes.append(type.id); - mm.parameters.append(arg.name.toLatin1()); - mm.parameters.append(','); + mm.parameterNames.append(arg.name.toLatin1()); prototype.append(type.name); prototype.append(','); @@ -304,12 +327,10 @@ void QDBusMetaObjectGenerator::parseSignals() if (!ok) continue; // convert the last commas: - if (!mm.parameters.isEmpty()) { - mm.parameters.truncate(mm.parameters.length() - 1); + if (!mm.parameterNames.isEmpty()) prototype[prototype.length() - 1] = ')'; - } else { + else prototype.append(')'); - } // meta method flags mm.flags = AccessProtected | MethodSignal | MethodScriptable; @@ -342,49 +363,27 @@ void QDBusMetaObjectGenerator::parseProperties() if (p.access != QDBusIntrospection::Property::Read) mp.flags |= Writable; - if (mp.typeName == "QDBusVariant") - mp.flags |= QMetaType::QVariant << 24; - else if (mp.type < 0xff) - // encode the type in the flags - mp.flags |= mp.type << 24; - // add the property: properties.insert(name, mp); } } -void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) +// Returns the sum of all parameters (including return type) for the given +// \a map of methods. This is needed for calculating the size of the methods' +// parameter type/name meta-data. +int QDBusMetaObjectGenerator::aggregateParameterCount(const QMap<QByteArray, Method> &map) { - class MetaStringTable - { - public: - typedef QHash<QByteArray, int> Entries; // string --> offset mapping - typedef Entries::const_iterator const_iterator; - Entries::const_iterator constBegin() const - { return m_entries.constBegin(); } - Entries::const_iterator constEnd() const - { return m_entries.constEnd(); } - - MetaStringTable() : m_offset(0) {} - - int enter(const QByteArray &value) - { - Entries::iterator it = m_entries.find(value); - if (it != m_entries.end()) - return it.value(); - int pos = m_offset; - m_entries.insert(value, pos); - m_offset += value.size() + 1; - return pos; - } - - int arraySize() const { return m_offset; } - - private: - Entries m_entries; - int m_offset; - }; + int sum = 0; + QMap<QByteArray, Method>::const_iterator it; + for (it = map.constBegin(); it != map.constEnd(); ++it) { + const Method &m = it.value(); + sum += m.inputTypes.size() + qMax(1, m.outputTypes.size()); + } + return sum; +} +void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) +{ // this code here is mostly copied from qaxbase.cpp // with a few modifications to make it cleaner @@ -396,8 +395,14 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) QVarLengthArray<int> idata; idata.resize(sizeof(QDBusMetaObjectPrivate) / sizeof(int)); + int methodParametersDataSize = + ((aggregateParameterCount(signals_) + + aggregateParameterCount(methods)) * 2) // types and parameter names + - signals_.count() // return "parameters" don't have names + - methods.count(); // ditto + QDBusMetaObjectPrivate *header = reinterpret_cast<QDBusMetaObjectPrivate *>(idata.data()); - Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 6, "QtDBus meta-object generator should generate the same version as moc"); + Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 7, "QtDBus meta-object generator should generate the same version as moc"); header->revision = QMetaObjectPrivate::OutputRevision; header->className = 0; header->classInfoCount = 0; @@ -405,7 +410,7 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) header->methodCount = signals_.count() + methods.count(); header->methodData = idata.size(); header->propertyCount = properties.count(); - header->propertyData = header->methodData + header->methodCount * 5; + header->propertyData = header->methodData + header->methodCount * 5 + methodParametersDataSize; header->enumeratorCount = 0; header->enumeratorData = 0; header->constructorCount = 0; @@ -417,7 +422,7 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) header->methodDBusData = header->propertyDBusData + header->propertyCount * intsPerProperty; int data_size = idata.size() + - (header->methodCount * (5+intsPerMethod)) + + (header->methodCount * (5+intsPerMethod)) + methodParametersDataSize + (header->propertyCount * (3+intsPerProperty)); foreach (const Method &mm, signals_) data_size += 2 + mm.inputTypes.count() + mm.outputTypes.count(); @@ -425,10 +430,11 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) data_size += 2 + mm.inputTypes.count() + mm.outputTypes.count(); idata.resize(data_size + 1); - MetaStringTable strings; + QMetaStringTable strings; strings.enter(className.toLatin1()); int offset = header->methodData; + int parametersOffset = offset + header->methodCount * 5; int signatureOffset = header->methodDBusData; int typeidOffset = header->methodDBusData + header->methodCount * intsPerMethod; idata[typeidOffset++] = 0; // eod @@ -439,16 +445,45 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) QMap<QByteArray, Method> &map = (x == 0) ? signals_ : methods; for (QMap<QByteArray, Method>::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it) { - // form "prototype\0parameters\0typeName\0tag\0methodname\0" const Method &mm = it.value(); - idata[offset++] = strings.enter(it.key()); // prototype - idata[offset++] = strings.enter(mm.parameters); - idata[offset++] = strings.enter(mm.typeName); + int argc = mm.inputTypes.size() + qMax(0, mm.outputTypes.size() - 1); + + idata[offset++] = strings.enter(mm.name); + idata[offset++] = argc; + idata[offset++] = parametersOffset; idata[offset++] = strings.enter(mm.tag); idata[offset++] = mm.flags; - idata[signatureOffset++] = strings.enter(mm.name); + // Parameter types + for (int i = -1; i < argc; ++i) { + int type; + QByteArray typeName; + if (i < 0) { // Return type + if (!mm.outputTypes.isEmpty()) + type = mm.outputTypes.first(); + else + type = QMetaType::Void; + } else if (i < mm.inputTypes.size()) { + type = mm.inputTypes.at(i); + } else { + Q_ASSERT(mm.outputTypes.size() > 1); + type = mm.outputTypes.at(i - mm.inputTypes.size() + 1); + // Output parameters are references; type id not available + typeName = QMetaType::typeName(type); + typeName.append('&'); + } + Q_ASSERT(type != QMetaType::UnknownType); + int typeInfo; + if (!typeName.isEmpty()) + typeInfo = IsUnresolvedType | strings.enter(typeName); + else + typeInfo = type; + idata[parametersOffset++] = typeInfo; + } + // Parameter names + for (int i = 0; i < argc; ++i) + idata[parametersOffset++] = strings.enter(mm.parameterNames.at(i)); idata[signatureOffset++] = typeidOffset; idata[typeidOffset++] = mm.inputTypes.count(); @@ -462,9 +497,12 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) } } - Q_ASSERT(offset == header->propertyData); + Q_ASSERT(offset == header->methodData + header->methodCount * 5); + Q_ASSERT(parametersOffset = header->propertyData); Q_ASSERT(signatureOffset == header->methodDBusData + header->methodCount * intsPerMethod); Q_ASSERT(typeidOffset == idata.size()); + offset += methodParametersDataSize; + Q_ASSERT(offset == header->propertyData); // add each property signatureOffset = header->propertyDBusData; @@ -472,9 +510,10 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) it != properties.constEnd(); ++it) { const Property &mp = it.value(); - // form is "name\0typeName\0signature\0" + // form is name, typeinfo, flags idata[offset++] = strings.enter(it.key()); // name - idata[offset++] = strings.enter(mp.typeName); + Q_ASSERT(mp.type != QMetaType::UnknownType); + idata[offset++] = mp.type; idata[offset++] = mp.flags; idata[signatureOffset++] = strings.enter(mp.signature); @@ -484,14 +523,8 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) Q_ASSERT(offset == header->propertyDBusData); Q_ASSERT(signatureOffset == header->methodDBusData); - char *string_data = new char[strings.arraySize()]; - { - MetaStringTable::const_iterator it; - for (it = strings.constBegin(); it != strings.constEnd(); ++it) { - memcpy(string_data + it.value(), it.key().constData(), it.key().size()); - string_data[it.value() + it.key().size()] = '\0'; - } - } + char *string_data = new char[strings.blobSize()]; + strings.writeBlob(string_data); uint *uint_data = new uint[idata.size()]; memcpy(uint_data, idata.data(), idata.size() * sizeof(int)); @@ -499,7 +532,7 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) // put the metaobject together obj->d.data = uint_data; obj->d.extradata = 0; - obj->d.stringdata = string_data; + obj->d.stringdata = reinterpret_cast<const QByteArrayData *>(string_data); obj->d.superdata = &QDBusAbstractInterface::staticMetaObject; } @@ -613,22 +646,12 @@ static inline const QDBusMetaObjectPrivate *priv(const uint* data) return reinterpret_cast<const QDBusMetaObjectPrivate *>(data); } -const char *QDBusMetaObject::dbusNameForMethod(int id) const -{ - //id -= methodOffset(); - if (id >= 0 && id < priv(d.data)->methodCount) { - int handle = priv(d.data)->methodDBusData + id*intsPerMethod; - return d.stringdata + d.data[handle]; - } - return 0; -} - const int *QDBusMetaObject::inputTypesForMethod(int id) const { //id -= methodOffset(); if (id >= 0 && id < priv(d.data)->methodCount) { int handle = priv(d.data)->methodDBusData + id*intsPerMethod; - return reinterpret_cast<const int*>(d.data + d.data[handle + 1]); + return reinterpret_cast<const int*>(d.data + d.data[handle]); } return 0; } @@ -638,7 +661,7 @@ const int *QDBusMetaObject::outputTypesForMethod(int id) const //id -= methodOffset(); if (id >= 0 && id < priv(d.data)->methodCount) { int handle = priv(d.data)->methodDBusData + id*intsPerMethod; - return reinterpret_cast<const int*>(d.data + d.data[handle + 2]); + return reinterpret_cast<const int*>(d.data + d.data[handle + 1]); } return 0; } diff --git a/src/dbus/qdbusmetaobject_p.h b/src/dbus/qdbusmetaobject_p.h index 7a8de41fa0..98d6105c72 100644 --- a/src/dbus/qdbusmetaobject_p.h +++ b/src/dbus/qdbusmetaobject_p.h @@ -71,12 +71,11 @@ struct Q_DBUS_EXPORT QDBusMetaObject: public QMetaObject QDBusError &error); ~QDBusMetaObject() { - delete [] d.stringdata; + delete [] reinterpret_cast<const char *>(d.stringdata); delete [] d.data; } // methods (slots & signals): - const char *dbusNameForMethod(int id) const; const int *inputTypesForMethod(int id) const; const int *outputTypesForMethod(int id) const; diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp index b0d640608a..7c8d8cf679 100644 --- a/src/dbus/qdbusmetatype.cpp +++ b/src/dbus/qdbusmetatype.cpp @@ -311,7 +311,7 @@ bool QDBusMetaType::demarshall(const QDBusArgument &arg, int id, void *data) int QDBusMetaType::signatureToType(const char *signature) { if (!signature) - return QVariant::Invalid; + return QMetaType::UnknownType; QDBusMetaTypeId::init(); switch (signature[0]) @@ -378,7 +378,7 @@ int QDBusMetaType::signatureToType(const char *signature) } // fall through default: - return QVariant::Invalid; + return QMetaType::UnknownType; } } diff --git a/src/dbus/qdbusmisc.cpp b/src/dbus/qdbusmisc.cpp index 7d68bf1185..88bab88a13 100644 --- a/src/dbus/qdbusmisc.cpp +++ b/src/dbus/qdbusmisc.cpp @@ -141,7 +141,7 @@ int qDBusParametersForMethod(const QMetaMethod &mm, QList<int>& metaTypes) for ( ; it != end; ++it) { const QByteArray &type = *it; if (type.endsWith('*')) { - //qWarning("Could not parse the method '%s'", mm.signature()); + //qWarning("Could not parse the method '%s'", mm.methodSignature().constData()); // pointer? return -1; } @@ -152,7 +152,7 @@ int qDBusParametersForMethod(const QMetaMethod &mm, QList<int>& metaTypes) int id = QMetaType::type(basictype); if (id == 0) { - //qWarning("Could not parse the method '%s'", mm.signature()); + //qWarning("Could not parse the method '%s'", mm.methodSignature().constData()); // invalid type in method parameter list return -1; } else if (QDBusMetaType::typeToSignature(id) == 0) @@ -164,14 +164,14 @@ int qDBusParametersForMethod(const QMetaMethod &mm, QList<int>& metaTypes) } if (seenMessage) { // && !type.endsWith('&') - //qWarning("Could not parse the method '%s'", mm.signature()); + //qWarning("Could not parse the method '%s'", mm.methodSignature().constData()); // non-output parameters after message or after output params return -1; // not allowed } int id = QMetaType::type(type); - if (id == 0) { - //qWarning("Could not parse the method '%s'", mm.signature()); + if (id == QMetaType::UnknownType) { + //qWarning("Could not parse the method '%s'", mm.methodSignature().constData()); // invalid type in method parameter list return -1; } diff --git a/src/dbus/qdbusxmlgenerator.cpp b/src/dbus/qdbusxmlgenerator.cpp index a6572b2c86..550c82a0f2 100644 --- a/src/dbus/qdbusxmlgenerator.cpp +++ b/src/dbus/qdbusxmlgenerator.cpp @@ -126,7 +126,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method // now add methods: for (int i = methodOffset; i < mo->methodCount(); ++i) { QMetaMethod mm = mo->method(i); - QByteArray signature = mm.signature(); + QByteArray signature = mm.methodSignature(); int paren = signature.indexOf('('); bool isSignal; |