Hello! I have a little problem with the usage of the introspection XML file generated by HAL and the QDBusAbstractInterface::callWithArgumentList() method, but don't know exactly whether is a Qt problem or a HAL one, let me explain the scenario:

- first, obtain the XML introspection from the "org.freedesktop.Hal.Manager" D-Bus interface:
Qt Code:
  1. $ qdbus --system org.freedesktop.Hal /org/freedesktop/Hal/Manager org.freedesktop.DBus.Introspectable.Introspect > Hal.Manager.xml
To copy to clipboard, switch view to plain text mode 

- second, use the XML file to obtain a C++ Qt class proxy in order to have an easy way of using the various methods of the Hal.Manager interface:
Qt Code:
  1. $ qdbusxml2cpp -c QHalManagerInterface -N -p QHalManagerInterface Hal.Manager.xml org.freedesktop.Hal.Manager
To copy to clipboard, switch view to plain text mode 
This generates the cpp and h files for the class "QHalManagerInterface". Now it's time to use this class in our code.

- third, integrate the generated class in the code: create an instance of QHalManagerInterface, and call any of its methods. For example:
Qt Code:
  1. QHalManagerInterface* iface;
  2. QDBusConnection system = QDBusConnection::systemBus();
  3. if (system.isConnected()) {
  4. iface = new QHalManagerInterface("org.freedesktop.Hal", "/org/freedesktop/Hal/Manager", system, this);
  5. if (iface && iface->isValid()) {
  6. /* We see in the auto-generated QHalManagerInterface.h that the method
  7. * GetAllDevices() returns a QDBusReply<QList<QDBusObjectPath> > */
  8. QDBusReply<QList<QDBusObjectPath> > reply = iface->GetAllDevices();
  9. if (reply.isValid()) {
  10. foreach(QDBusObjectPath udi, reply.value()) {
  11. qDebug() << "Found the device:" << udi.path();
  12. }
  13. }
  14. else {
  15. qDebug() << QString("D-Bus error: %1: %2").arg(reply.error.name()).arg(reply.error.message());
  16. }
  17. }
  18. }
To copy to clipboard, switch view to plain text mode 

Then you obtain the following in the console:
Qt Code:
  1. D-Bus error: org.freedesktop.DBus.Error.InvalidSignature: Unexpected reply signature: got "no signature", expected "" (QList<QDBusObjectPath>)
To copy to clipboard, switch view to plain text mode 

BUT, it all works by changing the type of return of the GetAllDevices() method, from QDBusReply<QList<QDBusObjectPath> > to QDBusReply<QStringList>.

So maybe QDBusReply is failing to adapt the signature of the "org.freedesktop.Hal.Manager.GetAllDevices" (which HAL claims to be "ao", an "array of objectpaths"), or maybe the problem is HAL claiming the method interface as "ao" but then expecting to be "as" at runtime?