Are D-Bus signals received by the emitting app?

Matthias Kretz kretz at kde.org
Sat Sep 29 12:46:57 BST 2007


On Saturday 29 September 2007, David Jarvie wrote:
> On Saturday 29 September 2007 12:18:13 Thiago Macieira wrote:
> > David Jarvie wrote:
> > >I'm attempting to write a unit test for some changes to the
> > > KSystemTimeZones class, but when the unit test emits a D-Bus signal, it
> > > is not picked up by the KSystemTimeZones instance which is instanciated
> > > within the unit test. When the same signal is emitted by ktimezoned, it
> > > is picked up by KSystemTimeZones in a different app. Can a D-Bus signal
> > > be received by the same app which emitted it? If not, is there any way
> > > round this so that the unit test instance can be made to think it's
> > > receiving the signal?
> >
> > They are received if there's something listening for it.
> >
> > Signal reception requires the event loop.
>
> How can an event loop be implemented in a unit test based on
> QTEST_KDEMAIN_CORE?

QTest::kWaitForSignal (it's in qtest_kde.h)

take a look at phonon tests for examples. mediaobjecttest is making a lot of 
use of the kWaitForSignal call

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- 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/20070929/c817563d/attachment.sig>


More information about the kde-core-devel mailing list