Some porting from KIO::Jobs to KJobs
Ricard Marxer Piñón
rmarxer at iua.upf.edu
Thu Jan 18 12:31:41 GMT 2007
Kevin Krammer wrote:
> 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.
>
You're right. So ignore the second part of my post.
I still think that:
myJob->setProgress(KJob::UNKNOWN)
is a good idea for these situations, and the uiserver applet could
handle it as a bouncing progress bar.
> Cheers,
> Kevin
>
>
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the kde-core-devel
mailing list