[Patch] SlaveBase progress...

David Faure faure at kde.org
Thu May 19 22:45:18 BST 2005


On Thursday 19 May 2005 23:11, Craig Drummond wrote:
> I've noticed, and so have others (http://bugs.kde.org/show_bug.cgi?id=96108), 
> that the progress data shown in the UI server's progress dialog is 
> inconsistent with the real progress.
> 
> Looking at kio/slavebase.cpp, I discovered that SlaveBase::processedSize() 
> only emits if it has been greater than 100ms since the last update.  However, 
> when copying from file:/ to fonts:/ (or event to file:/) the frequency of 
> calling processedSize is quicker than 100ms, so most (all?) updates are not 
> emitted. 
> 
> For example, if I have a font of 99k,  I call SlaveBase::totalSize() with this 
> value, and then read 32k chunks of date. For each chunk read I call 
> SlaveBase::processedSize(). As reading from a file is very fast, only the 1st 
> call to SlaveBase::processedSize() ever emits a signal. This causes the 
> progress bar to only be updated with the 1st 32k chunk of each file - with 
> the results being similar to the bug report mentioned above.
> 
> The attached patch "fixes" this by forcing an update if 
> processedSize==totalSize. Is this OK to commit? Or is there a better 
> solution?

Good catch!
Thanks.

-- 
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