<br><br><div class="gmail_quote">2009/4/6 Alessandro Diaferia <span dir="ltr"><<a href="mailto:alediaferia@gmail.com">alediaferia@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div class="gmail_quote"><div class="im">2009/4/6 Kevin Ottens <span dir="ltr"><<a href="mailto:ervin@kde.org" target="_blank">ervin@kde.org</a>></span><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div>On Monday 6 April 2009 19:27:08 Alessandro Diaferia wrote:<div><div></div><div class="h5"><br>
> For me the default behavior should be KJob::EmitResult and not<br>
> KJob::Quietly.. but those are just my 2 cents :)<br>
<br>
</div></div></div><div><div></div><div class="h5">That's your opinion now because you're looking at this particular problem. The<br>
thing to keep in mind is that most of the time kill() is called because of<br>
user cancellation, and most of the code out there just doesn't treat this<br>
special case of "error" (wouldn't make sense to duplicate the same if again<br>
and again right?). So what would happen if we made EmitResult by default is<br>
that in most cases of user cancellation, the user would then get a dialog<br>
claiming that the job failed... which isn't true, and isn't desirable to put<br>
into the face of the user (he knows he killed the task, he clicked on the<br>
button).<br>
<br>
That's why EmitResult is a possibility but not the default, and shall not be<br>
the default. Now the apidox of the signals should be more explicit about that,<br>
and refer to kill(). It should also perhaps be made more explicit that<br>
finished() is not meant to be used outside of job trackers (although right now<br>
it's not gonna bite your head off if you do it).<br>
<br>
And again, looking at the patch it seems that the problem is simply resetting<br>
the m_job pointer to 0 when the job deletes itself. There's a proper tool for<br>
that and it is called QPointer. So why not simply using that?<br>
<div><div></div><div><br>
Regards.<br>
--<br>
Kévin 'ervin' Ottens, <a href="http://ervin.ipsquad.net" target="_blank">http://ervin.ipsquad.net</a><br>
"Ni le maître sans disciple, Ni le disciple sans maître,<br>
Ne font reculer l'ignorance."<br>
<br>
</div></div></div></div></blockquote></div><br>Ok then, thanks for your clear explanation.. I'll go for QPointer and try :)<br clear="all"><font color="#888888"><br>-- <br>Alessandro Diaferia<br>KDE Developer<br>
</font></blockquote></div><br>Thanks to Kevin, it seems to work fine.. Ok to commit from you?<br clear="all"><br>-- <br>Alessandro Diaferia<br>KDE Developer<br>