Debugger error reporting

Andreas Pakulat apaku at gmx.de
Sat Jul 25 17:00:29 UTC 2009


On 25.07.09 20:49:48, Vladimir Prus wrote:
> 
> I've just spend some time figuring why "F9" does nothing, without
> any reporting whatsoever. I have arrive at the code below:
>
> 818664      rodda void KDevelop::RunController::registerJob(KJob * job)
> 818664      rodda {
> 818664      rodda     if (!job)
> 741686      rodda         return;
> 824972      rodda 
> 818664      rodda     if (!d->jobs.contains(job)) {
> 819335      rodda         KAction* stopJobAction = new KAction(job->objectName().isEmpty() ? i18n("Unnamed job") : job->objectName(), this);
> 819335      rodda         stopJobAction->setData(QVariant::fromValue(static_cast<void*>(job)));
> 819335      rodda         d->stopAction->addAction(stopJobAction);
> 961895      apaku         //TODO: This produces nasty messageboxes atm, so re-activate only after
> 961895      apaku         //moving to a nicer job delegate
> 961895      apaku         // connect( job, SIGNAL(finished(KJob*)), SLOT(finished(KJob*)) );
> 
> Putting the connect back makes things work. I have two questions:
> 
> 1. Does anyone agree that while messageboxes might be nasty, it's better than having
> real errors silently ignored?

I'm not sure, I'd rather have a better way of reporting the error
message before re-activating this. And IIRC there have been lots of
error boxes shown due to this.

> 2. Later on, that function does:
> 
> 	IRunController::registerJob(job);
> 
> which is actually:
> 
>     http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/kjobtrackerinterface_8cpp-source.html#l00046
> 
> and it contains essentially the same connect. Why is that not having any effect?

Thats easy I think, its a limitation of the meta-object system and its
signals/slots. The connect connects the signal and the finished method
of KJobTrackerInterface and during calling the slot it calls that
version, not the virtual override from the subclass.

Apparently whoever designed the interface didn't know about that.

Andreas

-- 
Everything that you know is wrong, but you can be straightened out.




More information about the KDevelop-devel mailing list