[Interest] QDBus Dict

Thiago Macieira thiago.macieira at intel.com
Sat Jul 7 10:55:46 CEST 2012


On sábado, 7 de julho de 2012 09.22.50, Lucas Betschart wrote:
> Thats my code:
> 
> bool QUbuntuOne::getThrottlingLimits(){
>     QDBusMessage ret =
> QDBusCon->call(QDBusMessage::createMethodCall(DESTINATION,"/config","","get_
> throttling_limits")); if(ret.type() == QDBusMessage::ErrorMessage){
>         qDebug() << "DBus Error:\n" << QDBusCon->lastError().name() <<
> "\n" << QDBusCon->lastError().message();
>         return (false);
>     }
>     //ret.arguments().t
>     return true;
> }
> 
> How can I convert what the QDBusMessage arguments I got in ret to a QMap?

The first variant in the arguments contains something that can be converted to 
your map. Use:

    qdbus_cast<QMap<Key, Value> >(ret.arguments().first());

> I also don't understand for what the "Interface" parameter in
> createMethodCall is. It seems to work well with out this till now (I
> have only implemented DBus methodes till now, no signals).

The D-Bus specification says that you can make calls to the empty interface and 
this needs to work, calling any method with that name in any interface. If you 
have a specific interface in mind, use it.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120707/9ed90eb0/attachment.sig>


More information about the Interest mailing list