[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Help on KIO::file_copy()
From:       David Faure <david () mandrakesoft ! com>
Date:       2001-11-26 9:28:05
[Download RAW message or body]

On Monday 26 November 2001 09:21, francesco.mezzanotte@inwind.it wrote:
> Hi everybody ,
> I'm trying to build a downloader for KDE and don't know how to resume an 
> incomplete download.
> How do I inform KIO about the offset of bytes already downloaded in order to 
> correctly resume the file without invoking the resume/overwrite dialog ?
> I played around with flags in KIO::file_copy() method but I saw that if i set 
> true for resume it appends the entire file at the end of the partially 
> downloaded one so I thought it was a offset  problem ...
> Can anybody help me?

It's currently the target slave (e.g. kio_file) which sends a command to say
"I can resume at offset NNN", if it finds a .part file.

One solution would be (next friday) to make FileCopyJob::slotCanResume virtual, 
so that you can reimplement it to avoid the resume/overwrite dialog.
Although this means digging into quite some internals, i.e. having access
to m_getJob and m_putJob to check which one emitted the signal, etc.
(just as FileCopyJob currently does).
Another solution would be a bool in FileCopyJob (with a set() method)
to automatically resume when possible.

In both cases you'd still need kio_file to find a .part file, but I guess 
that's no problem ?

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://perso.mandrakesoft.com/~david/ , http://www.konqueror.org/
KDE 3.0: Konquering the Desktops

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic