qdbusreply: unexpected reply signature?
Unsolved
General and Desktop
-
What's wrong with the following snippet?
I am constantly getting the errorUnexpected reply signature: got "a{sa{sv}}", expected "" (QMap<QString,QVariantMap>)
Snippet:
QDBusInterface connIface( NM_DBUS_SERVICE, "/org/freedesktop/NetworkManager/Settings/1", NM_DBUS_INTERFACE_SETTINGS_CONNECTION, QDBusConnection::systemBus()); QDBusReply<QMap<QString, QMap<QString, QVariant>> > settingsResult = connIface.call("GetSettings");
I really don't get it. Why is the signature once shown in the short format and once in the long one?
The code itself seems perfectly fine to me. Is it possible that this has to do with the compiler / header / dbuslib-versions somehow?
-
You have to register the expected Response first!
In my case it was like
#include <QtDBus/QDBusMetaType> // ... typedef QMap<QString, QMap<QString, QVariant> > ConnectionDetails; Q_DECLARE_METATYPE(ConnectionDetails)
and
int main() { qDBusRegisterMetaType<ConnectionDetails>(); // ... }