KIO question - synchronous IO?

David Faure faure at kde.org
Wed Nov 19 07:39:50 CET 2003


On Tuesday 18 November 2003 22:15, Leo Savernik wrote:
> Am Dienstag, 18. November 2003 21:55 schrieb Maciej Stachowiak:
> > Does KIO have a way to execute a job synchronously, or otherwise do
> > sync I/O? I think I will need this for the sync loading feature of
> > XMLHttpRequest. If not, I can do that part of it in #ifdef
> > APPLE_CHANGES for now. (Yes, I know it's terrible to let a script do
> > sync I/O, Microsoft designed it, not me.)
> 
> KIO::NetAccess simulates synchronous operations by (mis)using the Qt event 
> loop.

Yes - I would have suggested this first, as well.
But thinking about it, there's no need for a C++ function to be synchronous here,
all that matters is that a JS function appears to be synchronous.
So maybe one could pause the interpreter, set up signals and slots to the KIO Job,
and when the job completes, resume the interpreter from the slot, and the JS function
will then return. This would be much cleaner than a NetAccess hack.

-- 
David FAURE, faure at kde.org
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


More information about the Khtml-devel mailing list