Some porting from KIO::Jobs to KJobs
Rafael Fernández López
ereslibre at gmail.com
Wed Jan 17 13:38:39 GMT 2007
2007/1/17, Ricard Marxer Piñón <rmarxer at iua.upf.edu>:
> David Faure wrote:
> > On Wednesday 17 January 2007 10:39, Kevin Ottens wrote:
> >>> There's a meaning attached to it too.
> >>> totalSize could be about any kind of data. totalFiles is more specifically
> >>> about files. Maybe we need an API for telling uiserver what kind of objects
> >>> it's about, so that loaidng 2000 contacts shows "1 / 2000 contacts" instead
> >>> of "1 / 2000 files".
> >> That was exactly my point. totalSize() is enough, you just need a way to
> >> specify the unit.
> > 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.
> > So generalizing this leads to totalSize / totalItems / totalOtherItems ? ;)
> This should not replace the slotPercent methods, right?
Well it depends. Maybe yes and the percent could be computed on the
kuiserver, or maybe we could let the progress slot, and let the job
decide what it want to do. For example: If an app created a job that
inherited KJob is copying 1000 contacts and then it has to do
something with them (some heavy calculations), the progress could be
the overall progress (copying + computing), and the message could
change in running time with the infomessage slot, instead of getting
at 100% when finished copying, and then delete the job, so we can make
it more versatile.
> Generalizing even more it could lead to progressDescription(QString) and
> it's to the application to build the strings which I don't think is that
Applications don't have to know what the kuiserver does on the
implementation. So I don't think is a good idea an app sending
something like progressDescription("%1 of %1 contacts added");, since
the app shouldn't know that on the kuiserver we are doing something
like i18n(internationalizedText, howMany, howLeft);
> Some jobs might not even be made of subitems or they can be of different
> I agree these methods could be in KJob as helper functions, but should
> the Observer know about them? or should the Observer receive them as a
> simple progress description string.
As we talked before, probably the Observer will be removed. The
jobuidelegate or kjobuidelegate at kdeui can ask kuiserver.
Rafael Fernández López.
More information about the kde-core-devel