KJob deleting itself too early?

Andreas Pakulat apaku at gmx.de
Mon Nov 19 22:21:52 GMT 2007


On 19.11.07 23:06:09, David Faure wrote:
> On Sunday 18 November 2007, Andreas Pakulat wrote:
> > Hi,
> > 
> > I'd like to know why KJob deletes itself when he's done doing its work?
> > Shouldn't this be done by whoever creates the KJob?
> No, many jobs are fire-and-forget, and when they're not, people would forget to delete them.
> The job is done, it's done, it deletes itself. KDE3's KIO::Job has always worked like that.
> 
> > I don't think its a good idea to delete the job behind the back of the
> > user, in particular when you don't know how a KJob instance (or subclass
> > thereof) is used.
> Doesn't matter how it's used: after the job emits finished, it's finished :)

Yeah, but the problem is I can't access the data the job carries after a
run of the event loop. 

I don't care if KIO jobs are fire-and-forget, but for a general-purpose
job class in kdelibs/kdecore this just sounds like an uneeded
restriction. In particular this makes it impossible to have KJob provide
the job-implementation for KDevelop VCS support. 

Andreas

-- 
Don't look now, but the man in the moon is laughing at you.




More information about the kde-core-devel mailing list