diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2011-01-28 16:40:51 +0100 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2011-02-06 20:25:48 +0100 |
commit | fd2e832657a38d4dba9b86ce190f7736a837d53d (patch) | |
tree | 31d6fa6bf0596b4bf175d1e1f5ec4557592c3220 /src/dbus | |
parent | 4f29c5d5381a76f24e13628da3edc5b19c6b1cd2 (diff) | |
download | qt4-tools-fd2e832657a38d4dba9b86ce190f7736a837d53d.tar.gz |
Make qdbus show all types, even those that it doesn't know about
Diffstat (limited to 'src/dbus')
-rw-r--r-- | src/dbus/qdbusmetaobject.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp index 5fe0589ea9..66835052c8 100644 --- a/src/dbus/qdbusmetaobject.cpp +++ b/src/dbus/qdbusmetaobject.cpp @@ -169,6 +169,8 @@ QDBusMetaObjectGenerator::QDBusMetaObjectGenerator(const QString &interfaceName, } } +Q_DBUS_EXPORT bool qt_dbus_metaobject_skip_annotations = false; + QDBusMetaObjectGenerator::Type QDBusMetaObjectGenerator::findType(const QByteArray &signature, const QDBusIntrospection::Annotations &annotations, @@ -178,7 +180,7 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature, result.id = QVariant::Invalid; int type = QDBusMetaType::signatureToType(signature); - if (type == QVariant::Invalid) { + if (type == QVariant::Invalid && !qt_dbus_metaobject_skip_annotations) { // it's not a type normally handled by our meta type system // it must contain an annotation QString annotationName = QString::fromLatin1("com.trolltech.QtDBus.QtTypeName"); @@ -201,6 +203,20 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature, return result; // unknown type is invalid too result.name = typeName; + } else if (type == QVariant::Invalid) { + // this case is used only by the qdbus command-line tool + // invalid, let's create an impossible type that contains the signature + + if (signature == "av") { + result.name = "QVariantList"; + type = QVariant::List; + } else if (signature == "a{sv}") { + result.name = "QVariantMap"; + type = QVariant::Map; + } else { + result.name = "QDBusRawType::" + signature; + type = -1; + } } else { result.name = QVariant::typeToName( QVariant::Type(type) ); } |