Some porting from KIO::Jobs to KJobs

Kevin Krammer kevin.krammer at gmx.at
Thu Jan 18 11:18:22 GMT 2007


On Thursday 18 January 2007 12:55, Ricard Marxer Piñón wrote:
> Kevin Krammer wrote:

[snip]

> > Maybe jobs with unknown total should be handled differently. e.g.like a
> > QProgressBar has a mode for total==0, but more explicit.
>
> Maybe it does need one.  It could be handled as:
>
> myJob->setProgress(KJob::UNKNOWN);
>
> Although I do think it's better to avoid unknown length jobs, I would
> recommend to set a timeout and use the consumption of the timeout as the
> progress.
>
> If the job timeouts, then the job should be set to a state
> KJob::FINISHED_UNEXPECTEDLY with a new progressInfo and set some actions
> like retry or cancel.

I don't think this would be wise. The progress would reach 100% even when the 
jobs knows it is not finished yet. Even worse. displaying such actions 
as "retry" suggest that something went wrong while the job is likely to work 
as intended.

For example when downloading through HTTP and the server didn't set content 
size, you still known that you are progressing, you still can detect when you 
are finished, but  you do not know how far you are until you detect the end.

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070118/7a8d422d/attachment.sig>


More information about the kde-core-devel mailing list