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

David Jarvie djarvie at
Thu Aug 6 01:05:14 BST 2009

On Wednesday 05 August 2009 14:38:49 Thiago Macieira wrote:
> Em Quarta-feira 05 Agosto 2009, às 10:25:12, David Jarvie escreveu:
> > Following your
> > advice, that would imply that applications can't use their default D-Bus
> > service for a callable interface, but must instead set up an additional
> > service which they would register later. That might be practical for
> > objects/methods which the application explicitly creates, but what about
> > default ones like com.trolltech.Qt.QWidget?
> That's an interface, not an object path. Please don't mix the concepts.

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() == 

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.

David Jarvie.
KDE developer.
KAlarm author and maintainer.

More information about the kde-core-devel mailing list