How I can catch error during call method of proxy-class generated via qdusxml2cpp?

Thiago Macieira thiago at kde.org
Wed Nov 7 05:33:00 PST 2007


Em Wednesday 07 November 2007 13:48:47 Vitaly V. Ch escreveu:
> int main(int argc, char *argv[])
> {
>     ComI_zumJukeboxSim300Interface
> controller("com.i_zum.jukebox.sim300", "/",
> QDBusConnection::sessionBus());
>
>     QString res, money;
>
>     res = controller.get_money_atd(money);
>     if(res.isEmpty())
>         qWarning("Get_money_atd: %s\n", money.toLocal8Bit().data());
>     else
>         qWarning("Get_money_atd:FAILURE: %s\n", res.toLocal8Bit().data());
>
>     return 0;
> }
>
> at now if I run my programm when no service on
> com.i_zum.jukebox.sim300 is available then qWarning print something
> not related to exported method get_money_atd (). I want have method to
> determine service availabity during call
> controller.get_money_atd(money)
> and prevent non-sence process 'res' and 'money' if there was not a service.

Read:
http://doc.trolltech.com/4.3/qdbusreply.html

Your call to get_money_atd returns a QDBusReply<QString>, not QString.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20071107/a3712f04/attachment.pgp 


More information about the dbus mailing list