How to know when D-Bus interfaces and methods are available

Thiago Macieira thiago at kde.org
Wed Aug 5 07:31:21 BST 2009


David Jarvie wrote:
>There has been some discussion on the kde-pim list about how to
> successfully call D-Bus methods immediately after starting an
> application. The problem is that initially, only the D-Bus service for
> the application exists, and it is necessary to wait until first its
> interfaces and then its methods are ready to be used. Unfortunately
> there seems to be no clean way to know when the D-Bus methods are ready
> to be called.
>
>As pointed out by Ingo Klöcker, this is likely to be a problem
> encountered by others, so I'm forwarding the discussion to core-devel.

The solution is simple:

Don't register the service name until your objects are set up. Or, at the 
latest, make sure that they will be created before the next event loop 
run.

That's Thomas's solution. It's the correct way to go.

-- 
  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: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090805/b6d15b30/attachment.sig>


More information about the kde-core-devel mailing list