[PyQt] PyKDE3: how do you start a KIO.TransferJob?
mdione at grulic.org.ar
Tue May 27 04:26:21 BST 2008
On Mon, May 26, 2008 at 08:32:18AM +0100, Giacomo Lacava wrote:
> I'm trying to start a download using the KDE3 api. The following
> snippet will bring up the "progress" window, but the actual download
> never starts:
> job = kio.KIO.get(KURL(url),False,True)
> QObject.connect(job,SIGNAL('result( KIO::Job * )'),doSomethingOnResult)
I have a similar code, which works for me:
job= kio.KIO.copy (kdecore.KURL (url), self.file, False)
# 12:04 < mETz> StyXman: you need to return to the mainloop before the job gets started
# so there is no race condition over these connections
qt.QObject.connect (job, qt.SIGNAL ("result (KIO::Job *)"), self.readFeed)
def readFeed (self, job):
filename= self.file.path ()
if job.error ()==0:
see mETz' comment: you need to return to the main loop. only the the
jobs get started. does this help?
(Not so) Random fortune:
Consequently, you act irresponsibly when you adopt any programming
practice simply because "that's the way you're supposed to do things."
-- Allen Holub, http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html
More information about the PyQt