KIO split (from the Job side)

Kevin Ottens ervin at kde.org
Tue Apr 18 17:57:42 BST 2006


Le Mardi 18 Avril 2006 14:32, Volker Krause a écrit :
> On Tuesday 18 April 2006 09:37, Kevin Ottens wrote:
> > Yes, noticed this one. I'll add it as soon as possible.
> > Just one question though, will it play nicely with deleteLater() though,
> > since I use it in emitResult() (and KIO::Jobs are assumed to delete
> > themselves).
>
> Good point, I think it will work, but that's a question for a Qt event loop
> expert.

Or we can stay on the safe side and do it this way:
 - use deleteLater() in the "general" case (when start() is used)
 - don't autodelete for exec()'d jobs

The advantage is that we won't rely on an (maybe) obscure Qt event loop 
behavior that might change in time. The major drawback is that sometimes you 
have to delete sometimes you don't... that's inconsistent behavior.

That said it could be relevent from an API point of view. If you start() the 
job the user code just "launch and forget" which implies that the code that 
created the job and the one receving the result are generally in the same 
class, etc. If you exec() it the code that created the job and the one 
_requesting_ the result will be often in the same method, it also means that 
you expect the job object to stay alive longer.
Does it makes sense?

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060418/5d6413fd/attachment.sig>


More information about the kde-core-devel mailing list