[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: [Semi-OT] How to get a dbus array of dbus_object_path from a
From: Iván Forcada Atienza <ivan () swscanner ! org>
Date: 2007-02-20 1:13:00
Message-ID: 20070220011300.GA26871 () masao ! forcada ! info
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
Hi Thiago!
[lun, 19 feb 2007 20:12:49 +0100] - Thiago Macieira:
> Iván Forcada Atienza wrote:
> >Hmmm... I must be missing something because I keep getting
> >"InvalidSignature" error, no matter if I use QVariantMap or
> >QMap<QString,QVariant>, and even if I use qDBusRegisterMetaType and
> >Q_DECLARE_METATYPE.
>
> The attached example works just fine.
I'm afraid that I keep getting the same error:
Error is: QDBusError("org.freedesktop.DBus.Error.InvalidSignature", "Unexpected reply signature")
It seems that my example isn't a Map. Please, note the difference
between your target example:
dbus-send --system --print-reply --reply-timeout=2000
--type=method_call --dest=org.freedesktop.Hal
/org/freedesktop/Hal/devices/computer
org.freedesktop.Hal.Device.GetAllProperties
and mine:
dbus-send --system --print-reply --reply-timeout=2000
--type=method_call --dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager/Devices/ath0/Networks/WiForcada
org.freedesktop.NetworkManager.getProperties
Thanks 4 your patience :-)))
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> PGP/GPG: 0x6EF45358; fingerprint:
> E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
> #include <QtDBus>
> #include <QDebug>
> #include <QCoreApplication>
>
> int main(int argc, char **argv)
> {
> QCoreApplication app(argc, argv);
>
> QDBusConnection system = QDBusConnection::systemBus();
> if (!system.isConnected())
> return 1;
>
> QDBusInterface computer("org.freedesktop.Hal",
> "/org/freedesktop/Hal/devices/computer",
> "org.freedesktop.Hal.Device",
> system);
> if (!computer.isValid())
> return 1;
>
> QDBusMessage reply = computer.call("GetAllProperties");
> if (reply.type() != QDBusMessage::ReplyMessage)
> return 1;
>
> qDebug() << "Got a message reply with signature" << reply.signature();
>
> qDBusRegisterMetaType<QVariantMap>();
> QDBusReply<QVariantMap> properties = reply;
> if (properties.isValid())
> qDebug() << "Properties are:" << properties.value();
> else
> qDebug() << "Error is:" << properties.error();
> return 0;
> }
--
__________________________________________________________________
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