Version: 4.5 (using Devel) OS: Linux When I connect to KWallet from Perl using DBus (Net::DBus), and call KWallet's readMap function, I get back a bunch of binary data. From perusing kwalleteditor.h, it appears that this data is simply a binary dump of a QMap<QString,QString> object. This apparently works in C++, but does not do any good in other languages. Please add an API that would make this accessible in other languages. One possibility would be a readMapKeys which would return all the keys in the given map, and a readMapData which would take all the same input as readMap plus a key name, and return just the data for that key. Another possibility would be a readMapAsXML which would simply transform the entire map into XML and return that. Most languages would be able to handle that (though that might be more painful in C). Also, trying to find documentation on the kwallet DBus API was very difficult. I couldn't actually find any. Reproducible: Always
Isn't it the responsibility of your "bindings" to convert the data?
Even qdbusviewer is not able to convert the data because it is being returned as an array of bytes. Checking the introspection in qdbusviewer, I get (part of the result): <method name="readMap"> <arg direction="out" type="ay"/> Looking in dbus-protocol.h, I see "a" is for array, and "y" is for "byte". It's not returning a "QMap<QString,QString>", thus the general DBus binding cannot know how to convert the data back into normal data structures. Looking at dbus-protocol.h a bit further, I see a "dict" type - perhaps that's closer to the meaning of KWallet's map, and maybe that should be the return of readMap over DBus, instead of new APIs? (Though I don't know if the Perl bindings support dict yet.)
Just to add to this, I noticed that there is a dict type used for readMapList, which, again, has an odd return type: instead of being a dict of a dict, it, again, just seems to store the QMap<QString,QString> object as a QByteArray, which means again that I would need a binding that was particular to KWallet instead of generic to DBus in order to handle this. Basically, the output in qdbusviewer also does not show the actual mapping, it merely shows the numeric representation of each byte (e.g., "{0, 0, 0, 3, 0, 0, 0, 8, ...").
Yep, it would be really nice if readMap would return a DBus dict rather than a binary array.
Hi, kdelibs (version 4 and earlier) is no longer maintained since a few years. KDE Frameworks 5 or 6 might already have implemented this wish. If not, please re-open against the matching framework if feasible or against the application that shows the issue. We then can still dispatch it to the right Bugzilla product or component. Greetings Christoph Cullmann
This is still the case for Frameworks 5.115.0. I don't have KF6 installed at the moment.