listdir in NetAccess

David Faure david at
Sun Sep 15 18:00:24 BST 2002

Hash: SHA1

On Sunday 15 September 2002 18:33, Tobias Koenig wrote:
> On Sun, Sep 15, 2002 at 05:39:19PM +0200, David Faure wrote:
> > On Sunday 15 September 2002 17:19, Tobias Koenig wrote:
> Hi David,
> > > Hi,
> > > 
> > > I want to implement a listdir method for NetAccess but have a problem
> > > with KIO::listDir().
> > > I've attached my trials and the problematic code part is in
> > > NetAccess:slotResult(). How can I get the UDSEntryList of the listDir job
> > > here?
> > 
> > Connecting to the signal from ListDirJob which emits items.
> > (That's the only way, they don't get buffered in the job, so you can't
> > ask for them at the end).
> So no synchronous way is possible?

It is possible. Just connect that signal (to a slot in NetAccess), buffer the items there
(i.e. append to the list defined in the Private object) - and return that list when done.

> > But NetAccess is a hack, and a possibly dangerous one. Do we really need
> > to extend it? Why not use KIO::listDir() in your app?
> I need it in libkabc to access an IMAP server. But at the moment libkabc
> supports only synchronous requests.

I see.
Sounds like you won't have several NetAccess things running at the same
time, so you should be safe. The other problem is blocking the user interface
if the server or the network is very slow...

- -- 
David FAURE, david at, faure at
Contributing to:,
Get the latest KOffice -
Version: GnuPG v1.0.7 (GNU/Linux)


More information about the kde-core-devel mailing list