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

Thiago Macieira thiago at kde.org
Thu Aug 6 06:45:29 BST 2009


David Jarvie wrote:
>I meant, what about methods under the com.trolltech.Qt.QWidget
> interface? I've been trying to use one of its methods in kmail, but
> have hit exactly the problem which gave rise to this thread. If the the
> com.trolltech.Qt.QWidget interface (under path
> /kmail/kmail_mainwindow_1) is constructed as soon as org.kde.kmail
> service is available, the interface is invalid (isValid() == false).

a) don't use QDBusInterface

b) find out why it was invalid: it's probably because it did not exist when 
you created the QDBusInterface

c) don't use QDBusInterface, but that doesn't guarantee that the calls 
will succeed

Why are you trying to access the mainwindow anyway?

>The only obvious ways round this are (a) delay the creation of the app's
>default D-Bus service (which, as you have pointed out, is fraught for
>KUniqueApplication), (b) introduce QTimer delays, or (c) use Thomas's
> hack of creating an extra service once the interfaces are ready. But
> the last approach of course relies on the called application providing
> the extra service - most apps do not do so currently.

-- 
  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/20090806/9c946bc3/attachment.sig>


More information about the kde-core-devel mailing list