[PATCH] KIO::SlaveBase and the event loop

Sebastian Trüg strueg at mandriva.com
Tue Jul 15 20:47:38 BST 2008


On Tuesday 15 July 2008 17:56:40 Sebastian Trüg wrote:
> On Tuesday 15 July 2008 17:44:58 Thiago Macieira wrote:
> > Sebastian Trüg wrote:
> > >I create a local event loop in the listDir method and execute it after
> > >starting my thread that does all the dbus communication. DBus signals
> > > come in via a queued connection and are handled in the main thread
> > > (they create listEntry calls). Once the initial listing is done
> > > (search) I disconnect the dbus signals and reconnect them directly.
> > > That is because once my local event loop is done I still need to get
> > > the dbus signals to update my internal state and emit KDirNotify
> > > signals.
> > >It works but with a rather bis delay for the update signals that are to
> > > be delivered directly. I don't really understand that since my thread
> > > runs its own event loop.
> > >
> > >I hope this was not too confusing. ;)
> >
> > If you're going to use a separate thread for handling a D-Bus connection,
> > do not use QDBusConnection::sessionBus() nor
> > QDBusConnection::systemBus(). You must connect on your own.
>
> aha. that could be the problem since I was wrong: the signals after the
> re-connect don't get delivered at all.
>
> I will try with my own connection. Damn, that means to change the query
> client....

hm, my own connection created with
 
QDBusConnection::connectToBus(QDBusConnection::SessionBus,"NepomukQueryServiceConnection") 

does not change anything. The signals still do not get delivered properly.

Cheers,
Sebastian





More information about the kde-core-devel mailing list