Runcontroller KJobs question

Hamish Rodda rodda at kde.org
Tue Feb 17 21:38:26 UTC 2009


On Wednesday 18 February 2009 08:09:16 Vladimir Prus wrote:
> On Tuesday 17 February 2009 23:35:29 Andreas Pakulat wrote:
> > On 17.02.09 23:25:24, Vladimir Prus wrote:
> > > On Tuesday 17 February 2009 22:58:38 Andreas Pakulat wrote:
> > > > On 17.02.09 20:56:07, Vladimir Prus wrote:
> > > > > the runcontroller passes an KJob* to IRunProvider::execute. In case
> > > > > of debugger, I want to mark this job as done when debugger exits,
> > > > > either normally or due to GDB crash. How can I do that, given that
> > > > > all of KJob methods of interest are protected?
> > > >
> > > > Well, at some point that job is created and that is most probably not
> > > > a KJob, but  some subclass. That subclass should call emitResult()
> > > > when its "done" and also set any errors via setError and setErrorText
> > > > before that.
> > >
> > > That is created in runcontroller.cpp and the actual class is RunJob and
> > > IRunProvider is not in position to intercept construction of that
> > > class.
> > >
> > > But I've already found the right way -- it appears that if IRunProvider
> > > implementatation has a finished(KJob*) signal, it will be used. Of
> > > course, this is not documented anywhere :-P
> >
> > Maybe I'm missing something, but doesn't gdb-plugin create a job and tell
> > runcontroller to start it?
>
> No.
>
> > If not, why doesn't it do that?
>
> runcontroller interface does not allow such usage. I don't know why, I
> think Hamish wrote all of it.

This infrastructure was written before we had KJobs, and it worked on serial 
numbers, which I just replaced with the KJob for each run session.

I guess we could change this so the run provider creates the job, once it's 
been provided the IRun object, if people feel strongly about it.

I don't know why I didn't add finished() to the IRunProvider interface file, I 
guess it should go there if we're going to keep the current api.

Cheers,
Hamish.




More information about the KDevelop-devel mailing list