[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Synchronous KIO
From: Waldo Bastian <bastian () kde ! org>
Date: 2002-04-27 0:31:28
[Download RAW message or body]
On Friday 26 April 2002 04:43 pm, Charles Samuels wrote:
> fredag 26 april 2002, 03:15 pm, skrev Jay Cornwall:
> > Hi
> >
> > Is there a way to synchronously request a directory listing from a
> > kioslave, in a similar way to the methods that KIO::NetAccess provides?
> >
> > I ask, because my program needs to check the contents of a directory when
> > the user selects a menu item (it's a bit more complicated than that, but
> > that's the general idea).
> >
> > KIO::listDir() suggests an asynchronous slot-based system, but this is
> > difficult to fit into my program design. I'd have to start the request,
> > leave my slot (which is called when the menu item is selected), somehow
> > stop the user from issuing further GUI requests until the listDir() is
> > complete, and finish the request in a different slot.
> >
> > It would be easier if I could just start the request and wait for
> > completion in the menu slot (there isn't a lot else my program can do in
> > the mean time). Any ideas how I might implement this?
>
> You could call processEvents() until KIO is done. It just screams HACK,
> however :)
KIO::NetAccess has an "official hack" for this in NetAccess::enter_loop(),
maybe that concept could be generalized a bit. Something like
"NetAccess::runJob(KIO::Job *job)"
Cheers,
Waldo
--
bastian@kde.org | SuSE Labs KDE Developer | bastian@suse.com
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic