[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] PyKDE3: how do you start a KIO.TransferJob?
From: Marcos Dione <mdione () grulic ! org ! ar>
Date: 2008-05-27 3:26:21
Message-ID: 20080527032621.GB24420 () grulicueva ! homelinux ! net
[Download RAW message or body]
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
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic