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

Vitaly V. Ch vitaly.v.ch at gmail.com
Wed Nov 7 04:48:47 PST 2007


Ok

I generate interface class from attached com.i_zum.jukebox.sim300.xml
via qdbusxml2cpp and get as result class
ComI_zumJukeboxSim300Interface with method get_money_atd().

after i compile next simple programm:

#include <QtDBus>
#include <QtCore/QCoreApplication>

#include "sim300_dbus_interface.h"

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.



On Nov 7, 2007 2:30 PM, Thiago Macieira <thiago at kde.org> wrote:
> Em Wednesday 07 November 2007 13:04:25 Vitaly V. Ch escreveu:
> > for example if I call method det_data() of class ProxyClass but
> > service than provide than method is not up - method return garbadge
> > instead of error or same.
>
> Please illustrate with code. I cannot understand you.
>
> --
>  Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>   PGP/GPG: 0x6EF45358; fingerprint:
>   E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: com.i_zum.jukebox.sim300.xml
Type: text/xml
Size: 1182 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20071107/34a6de7c/attachment.bin 


More information about the dbus mailing list