[Qt-interest] [QtDBUS] Getting properties
Georg Grabler
georg at grabler.net
Mon Apr 11 19:52:16 CEST 2011
Hi guys and girls,
I'm lacking a bit the documentation for QtDbus (or working examples), that's
why I decided to ask here.
I'm trying to get the org.freedesktop.UDisks "KnownFilesystems" hash back
using a QDBusInterface.
Example code:
QDBusInterface fsif("org.freedesktop.UDisks",
"/org/freedesktop/UDisks", "org.freedesktop.UDisks",
QDBusConnection::systemBus());
QVariant fsreply = fsif.property("KnownFilesystems");
qDebug() << fsreply;
qDebug() << fsif.lastError();
Now, I realized I get nothing at all back:
QVariant(, )
QDBusError("", "")
If i use qdbusviewer, I get the following construct of this property,
which makes me believe it should actually work:
Arguments: [Variant: [Argument: a(ssbbbubbbbbbbb) {[Argument:
(ssbbbubbbbbbbb) "vfat", "FAT", false, true, true, 254, true, false,
true, false, false, false, false, false], [Argument: (ssbbbubbbbbbbb)
"ext2", "Linux Ext2", true, true, true, 16, true, true, true, false,
true, true, true, true], [Argument: (ssbbbubbbbbbbb) "ext3", "Linux
Ext3", true, true, true, 16, true, true, true, false, true, true,
true, true], [Argument: (ssbbbubbbbbbbb) "ext4", "Linux Ext4", true,
true, true, 16, true, true, true, false, true, true, true, true],
[Argument: (ssbbbubbbbbbbb) "btrfs", "BTRFS", true, true, true, 256,
false, false, true, false, true, true, true, true], [Argument:
(ssbbbubbbbbbbb) "xfs", "XFS", true, true, true, 12, true, false,
true, false, false, true, false, false], [Argument: (ssbbbubbbbbbbb)
"reiserfs", "ReiserFS", true, true, true, 16, true, false, true,
false, true, true, true, false], [Argument: (ssbbbubbbbbbbb) "minix",
"Minix", true, true, true, 0, false, false, true, false, false, false,
false, false], [Argument: (ssbbbubbbbbbbb) "ntfs", "NTFS", false,
true, true, 128, true, false, false, false, true, false, true, false],
[Argument: (ssbbbubbbbbbbb) "nilfs2", "NILFS2", true, true, true, 80,
true, false, false, false, false, false, false, false], [Argument:
(ssbbbubbbbbbbb) "swap", "Swap Space", false, false, true, 15, false,
false, false, false, false, false, false, false]}]]
Now, having said that, calling "simple" functions returning in example
a bool value works just fine:
QDBusInterface fsif("org.freedesktop.UDisks",
"/org/freedesktop/UDisks", "org.freedesktop.UDisks",
QDBusConnection::systemBus());
QVariant fsreply = fsif.property("DaemonVersion");
qDebug() << fsreply;
qDebug() << fsif.lastError();
Which makes me believe it has something to do with the complex data
structure being returned - or some other mistake. I wanted to look in
the code examples (ping-pong etc.), but sadly, the .cpp and .h files
were missing in the Qt distribution (probably a mistake by my
distribution?).
Can anyone point me in a direction to examples / documentation which
could bring me a step closer to what I want, or provide me with help
here?
Best regards,
Georg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110411/ecc527a5/attachment.html
More information about the Qt-interest-old
mailing list