Some porting from KIO::Jobs to KJobs

David Faure faure at kde.org
Thu Jan 18 00:43:59 GMT 2007


On Wednesday 17 January 2007 13:01, Kevin Ottens wrote:
> Le Mercredi 17 Janvier 2007 12:43, David Faure a écrit :
> > This works for the case of loading contacts, but not when it's indeed about
> > files. totalSize(2000) means 2000 bytes, not 2000 files, and you need
> > totalFiles/totalDirs in addition.
> 
> Right now, totalSize is what's used for percentage computation... I wonder 
> what percent() is supposed to convey then.

There are multiple levels.

In uiserver percent is what matters:
      return i18n( "%1 % of %2 " ).arg( percent ).arg( KIO::convertSize( totalSize ) );

Below, in the job (Job::emitPercent), the percent is calculated from processedSize and totalSize,
to have that code in one place and not require that the ioslaves have to do it.
The percent signal from the job is what goes to uiserver; so Thiago is wrong, it *is* used.

[Someone then added SlaveBase::processedPercent though, for the case where the total size can't
be known (e.g. kio_audiocd with compression), but that's not implemented yet.]

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list