io-slave & progress dialog

Craig Drummond Craig.Drummond at gmx.net
Wed May 19 11:13:13 BST 2004


> Well I see that ::copy() has two cases - nonRootSys and !nonRootSys,
> and only the 2nd one emits progress information...

Hmm... OK, well spotted - I'll fix this. This, however, is not the problem -
as this code is only executed when copying to fonts:/System.

> 
> We're talking about copy, not put, if you're copying file from the local
> system, right?

Nope. When I copy from file:/home/craig to fonts:/Personal it's the put
function of KioFonts that is called - I assume because source and dest are
different protocols.

> 
> Otherwise print out debug output from kio (processedSize and totalSize
> values), to see what the problem is.

Well I've added some cerr's to kio/kio/job.cpp - and I get the following:

...
SimpleJob::slotTotalSize size:188825
   url:/home/craig/Documents/Fonts/Alltype/ala355.ttf
SimpleJob::slotTotalSize size:188825
   url:/home/craig/Documents/Fonts/Alltype/ala355.ttf
FileCopyJob::slotTotalSize size:188825
   url:/home/craig/Documents/Fonts/Alltype/ala355.ttf
SimpleJob::slotProcessedSize size:98304
   url:/home/craig/Documents/Fonts/Alltype/ala355.ttf
Job::setProcessedSize size:98304
FileCopyJob::slotProcessedSize size:98304
   url:/home/craig/Documents/Fonts/Alltype/ala355.ttf
Job::setProcessedSize size:98304
CopyJob::slotProcessedSize m_processedSize:207195 data_size:98304
Job::setProcessedSize size:305499
CopyJob::slotProcessedSize - call emitPercent
Job::emitPercent processedSize:305499 totalSize:2259044
FilecopyJob::slotProcessedSize - call emitPercent
Job::emitPercent processedSize:98304 totalSize:188825
SimpleJob::slotProcessedSize - call emitPercent
Job::emitPercent processedSize:98304 totalSize:188825
...


There seems to be only 1 call to set the processed size - in this case to
98304, whereas the file size is actually 188825.

On the fonts:/ (i.e. destination) side  - what would trigger the updating of
processedSize?

> 
> 
> I wonder if this kind of code (run as root!) is very secure BTW...
>                     cmd+=("cp -f "); // "kfontinst install ");
>                     cmd+=tmpFileC;
> 
> What if destOrigC contains a space?? Or a semicolon?

OK, well spotted (again...). I'll change these to use KProcess::quote()

Craig.

-- 
"Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info





More information about the kde-core-devel mailing list