qtdbus: Export org.freedesktop.DBus.Peer interface when introspected

The ofD.Peer interface is automatically implemented when an object is
registered on DBus, but the ofD.Introspectable.Introspect method does
not show it.

You can test it by running

$ qdbus --literal <some service> <some object> \
>    org.freedesktop.DBus.Peer.Ping

$ qdbus --literal <some service> <some object> \
>    org.freedesktop.DBus.Peer.GetMachineId

Change-Id: I7062ba0cdae486d443011ee19cf3874aabf90205
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Daniele E. Domenichelli 2012-06-21 20:41:27 +02:00 committed by Qt by Nokia
parent b57e2162ef
commit 652d82991d

View File

@ -92,6 +92,14 @@ static const char propertiesInterfaceXml[] =
" </method>\n"
" </interface>\n";
static const char peerInterfaceXml[] =
" <interface name=\"org.freedesktop.DBus.Peer\">\n"
" <method name=\"Ping\"/>\n"
" <method name=\"GetMachineId\">\n"
" <arg name=\"machine_uuid\" type=\"s\" direction=\"out\"/>\n"
" </method>\n"
" </interface>\n";
static QString generateSubObjectXml(QObject *object)
{
QString retval;
@ -165,6 +173,7 @@ QString qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode &node
}
xml_data += QLatin1String( introspectableInterfaceXml );
xml_data += QLatin1String( peerInterfaceXml );
if (node.flags & QDBusConnection::ExportChildObjects) {
xml_data += generateSubObjectXml(node.obj);