This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Is it possible to download a binary file with the classes KdeNetwork/KGet?

Tags: None
(comma "," separated)
User avatar
eDog
Registered Member
Posts
15
Karma
0
OS
Hi,

I'm developing a KDE application to download some binary file from web and I'm searching a way to download these file with the classes KdeNetwork/KGet.

After searching for hours in the api.kde.org documentation (btw, very interesting!) I didn't found a way to do that.

Is it possible to do that with these class or I have to search another way?

Have a nice day.

P.S.: I don't want to use wget and parse its log file.. :thumbs_down:
P.P.S.: I hope my English is a bit understandable.. :'(


eDog,
proud KDE user since 2007
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
This should be done with KIO - A list of its classes is available here: http://api.kde.org/4.x-api/kdelibs-apid ... tated.html


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
eDog
Registered Member
Posts
15
Karma
0
OS
Thanks bcooksley,I've found this class which is the one I need.

http://api.kde.org/4.x-api/kdelibs-apid ... oader.html

But.. I've a problem: in the documentation is written I have to include downloader.h

Code: Select all
#include


But when I compile I get this error:

Code: Select all
error: downloader.h: No such file or directory


This means that the compiler doesn't found the "downloader.h" header..

So.. what header file do I have to include?

Thanks in advance. :-)


eDog,
proud KDE user since 2007
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Please ensure that the correct include directory has been set. You may wish to use KIO:KIO::CopyJob instead.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
eDog
Registered Member
Posts
15
Karma
0
OS
Ok, never mind, I'll use CopyJob.

Uhm, I've read some documentation.. and..

Can you give me an example of CopyJob?

Many thanks :D


eDog,
proud KDE user since 2007
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Use it as follows:
Code: Select all
CopyJob * fileTransfer = KIO::copy( source_location, destination_location, JobFlags );


More information available from here: http://api.kde.org/4.x-api/kdelibs-apid ... b6cc7b20e4


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell