[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: [Semi-OT] How to get a dbus array of dbus_object_path from a reply
From: Iván Forcada Atienza <ivan () swscanner ! org>
Date: 2007-02-12 9:16:15
Message-ID: 20070212091615.GC21532 () masao ! forcada ! info
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
Hi all.
I know that this is not a fully KDE issue, but it has to do with Qt4, so
maybe any of you have some hints. Here it is:
I'm trying to get the response from a dbus call using qt4 dbus module.
I'm able to get a QString reply without problems, but the problems
arrive when this reply is an aggregation of a primitive type (not
QStringList).
For example, if I want to get this:
ivan@masao:~$ dbus-send --system --print-reply --reply-timeout=2000 \
--type=method_call --dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager +org.freedesktop.NetworkManager.getDevices
method return sender=:1.2 -> dest=:1.28
array [
object path "/org/freedesktop/NetworkManager/Devices/ath0"
]
I code the following:
QDBusConnection bus = QDBusConnection::systemBus();
QDBusInterface dbus_iface(
"org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager",
"org.freedesktop.NetworkManager", bus);
QDBusReply<QStringList> reply = dbus_iface.call("getDevices");
if (!reply.isValid()) {
qDebug() << "Error: " << reply.error().message() << "(" << \
reply.error().name() << ")"; } else {
qDebug() << reply.value();
}
... but I always get:
Error: "Unexpected reply signature" ( "org.freedesktop.DBus.Error.InvalidSignature" \
)
It seems that the problem is that call() method is not returning a QStringList \
DBusReply. So I've changed it to QDBusVariant, QString, QDBusObjectPath ... but no
success.
Any hints??
Thanks in advance!!!
--
__________________________________________________________________
Iván Forcada Atienza:
correo: ivan@forcada.info
jabber: ivanfor@jabber.guadawireless.org
------------------------------------------------------------------
Nodo guada21 en GuadaWireless usando Debian GNU/Linux:
http://el21.guadawireless.net
------------------------------------------------------------------
"Software is like sex: it's better when it's free" (Linus Torvalds)
[Attachment #5 (application/pgp-signature)]
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic