diff options
Diffstat (limited to 'src/dbus/qdbusxmlgenerator.cpp')
-rw-r--r-- | src/dbus/qdbusxmlgenerator.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/dbus/qdbusxmlgenerator.cpp b/src/dbus/qdbusxmlgenerator.cpp index 7afeb66e09..35ca4b0b2d 100644 --- a/src/dbus/qdbusxmlgenerator.cpp +++ b/src/dbus/qdbusxmlgenerator.cpp @@ -101,10 +101,10 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method (!mp.isScriptable() && (flags & QDBusConnection::ExportNonScriptableProperties)))) continue; - int typeId = mp.userType(); - if (!typeId) + QMetaType type = mp.metaType(); + if (!type.isValid()) continue; - const char *signature = QDBusMetaType::typeToSignature(typeId); + const char *signature = QDBusMetaType::typeToSignature(type); if (!signature) continue; @@ -113,8 +113,8 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method QLatin1String(signature), accessAsString(mp.isReadable(), mp.isWritable())); - if (QDBusMetaType::signatureToType(signature) == QMetaType::UnknownType) { - const char *typeName = QMetaType(typeId).name(); + if (!QDBusMetaType::signatureToMetaType(signature).isValid()) { + const char *typeName = type.name(); retval += QLatin1String(">\n <annotation name=\"org.qtproject.QtDBus.QtTypeName\" value=\"%3\"/>\n </property>\n") .arg(typeNameToXml(typeName)); } else { @@ -153,29 +153,29 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method isSignal ? "signal" : "method", mm.name().constData()); // check the return type first - int typeId = mm.returnType(); - if (typeId != QMetaType::UnknownType && typeId != QMetaType::Void) { + QMetaType typeId = mm.returnMetaType(); + if (typeId.isValid() && typeId.id() != QMetaType::Void) { const char *typeName = QDBusMetaType::typeToSignature(typeId); if (typeName) { xml += QLatin1String(" <arg type=\"%1\" direction=\"out\"/>\n") .arg(typeNameToXml(typeName)); // do we need to describe this argument? - if (QDBusMetaType::signatureToType(typeName) == QMetaType::UnknownType) + if (!QDBusMetaType::signatureToMetaType(typeName).isValid()) xml += QLatin1String(" <annotation name=\"org.qtproject.QtDBus.QtTypeName.Out0\" value=\"%1\"/>\n") .arg(typeNameToXml(QMetaType(typeId).name())); } else { - qWarning() << "Unsupported return type" << typeId << QMetaType(typeId).name() << "in method" << mm.name(); + qWarning() << "Unsupported return type" << typeId.id() << typeId.name() << "in method" << mm.name(); continue; } } - else if (typeId == QMetaType::UnknownType) { + else if (!typeId.isValid()) { qWarning() << "Invalid return type in method" << mm.name(); continue; // wasn't a valid type } QList<QByteArray> names = mm.parameterNames(); - QList<int> types; + QList<QMetaType> types; QString errorMsg; int inputCount = qDBusParametersForMethod(mm, types, errorMsg); if (inputCount == -1) { @@ -208,7 +208,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method qUtf16Printable(name), signature, isOutput ? "out" : "in"); // do we need to describe this argument? - if (QDBusMetaType::signatureToType(signature) == QMetaType::UnknownType) { + if (!QDBusMetaType::signatureToMetaType(signature).isValid()) { const char *typeName = QMetaType(types.at(j)).name(); xml += QString::fromLatin1(" <annotation name=\"org.qtproject.QtDBus.QtTypeName.%1%2\" value=\"%3\"/>\n") .arg(isOutput ? QLatin1String("Out") : QLatin1String("In")) |