From kde-devel Mon Nov 26 09:28:05 2001 From: David Faure Date: Mon, 26 Nov 2001 09:28:05 +0000 To: kde-devel Subject: Re: Help on KIO::file_copy() X-MARC-Message: https://marc.info/?l=kde-devel&m=100676705226349 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 <<