Registered Member
|
Hi,
once again I need your help. :-P My programm starts a little KJob, copying some files. If KJob is finished, I want to generate some Links. But for this I need the filenames. But KJob can't give me these names. So I have to save them manualy. The Problem is, that there can be more than one KJob at the same time. So I have to figure out which KJob did which job. How would you do this? |
Administrator
|
Maybe use a QMap, which the Job is added to ( along with file name ) at the start, then when finished(KJob*) is emitted by your KJob, use QMap::value(KJob*) to retrieve the file name.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
KDE Developer
|
Hmm, the CopyJob has accessors for source and destination URLs, doesn't it?
Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
This sounds interesting, I will take a look.
Shure your right, but how do I use it? I'm starting this job like this:
But if I write something with this
this error will be shown:
|
KDE Developer
|
KIO::copy() returns a CopyJob pointer.
You either have to assign to a variable of this type or cast to this type if you assign to a base class pointer. Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
Thanks, I casted it like this:
|
KDE Developer
|
Ugh. You're doing C++, not C, so please use:
Pino Toscano
|
Registered Member
|
You're right. I'm learning so much here, thanks
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell