[PyKDE] Network Transparency Help

Jim Bublitz jbublitz at nwinternet.com
Tue May 16 17:25:29 BST 2006


On Tuesday 16 May 2006 04:30, Paul Waldo wrote:
> On Tuesday 16 May 2006 2:19 am, Jim Bublitz wrote:
> > >     def locateFiles(self):
> > >         startUrl = KURL(self._url)
> > >         job = KIO.listRecursive(startUrl)
> > >         QObject.connect(job, SIGNAL("entries(KIO::Job *,
> > > 		const KIO::UDSEntryList &)"), self.newItems)
> > >
> > >     def newItems(job, list):
> > >         print job
> > >         print list
> > >
> > >
> > > When I create an instance of FileLocator and call its locateFiles
> > > method, I get a progress dialog that hangs around for a while, but
> > > newItems() never gets called.  I was expecting that once
> > > listRecursive() found all the files, newItems() would be called with
> > > all of the found items in list.
> > >
> > > Any help or links to examples would be greatly appreciated!
> >
> > Have you tried using self.job in locateFiles()?
> >
> > Jim
>
> Thanks for the reply, Jim.  My impression from the KDE API docs as well as
> other sources is that the job, as created in locateFiles, is fairly
> worthless (at this point).  Let's say that I want to find all of the 10,000
> files on a remote machine over a 28.8 kbps dialup line.  While a painful
> plan :-), this may be something the user really needs to do.  The UI should
> not hang for the 10 minutes it would take to do this operation, hence the
> callbacks.  My impression is that once some files have been located by KDE,
> the newItems method would be called by KDE to indicate it found some files.
>  If I am wrong, please let me know!

I'm not sure of the mechanics of that -  you might get a better answer on one 
of the KDE lists. My observation is that if you want to operate on a large 
number of files, say with konqueror or kbear, KDE insists on doing what's 
effectively a 'stat' on every file and directory before it does the 
operation, which gives the behavior you indicate. However it does report 
file/directory names back to the progress dialog - I'm not sure if you can 
hook those there (might be a signal or slot you can attach to).

Jim




More information about the PyQt mailing list