How to know when D-Bus interfaces and methods are available
David Jarvie
djarvie at kde.org
Thu Aug 6 09:15:29 BST 2009
On Thu, August 6, 2009 6:45 am, Thiago Macieira wrote:
> 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?
Ideally I'd like to start the app minimised - instead, I'm starting it and
then trying to minimise the window. This could alternatively be done using
KWindowSystem, but for that the window ID is needed, for which a D-Bus
call is needed to fetch it - resulting in the same problem.
--
David Jarvie.
KDE developer.
KAlarm author & maintainer.
http://www.astrojar.org.uk/kalarm
More information about the kde-core-devel
mailing list