printing html content on the retreive

David Faure faure at kde.org
Tue Jun 22 21:49:27 BST 2004


On Tuesday 22 June 2004 22:26, jesso1607 at rogers.com wrote:
> I would like to print the content body when getting the response from the server.
> 
> In kdelibs/kioslave/http/http.cc, method readBody I put some debug statements that print m_bufReceive. 
> 
> I don't get any data printed before returning from the method.

So you get debug but no body contents, or no debug at all?
A common mistake is to miss the fact that debug output from kioslaves goes
to ~/.xsession-errors or to the terminal where you restart kdeinit.

Now if you knew all that and the problem is where to put the debug:
note that readBody has two main cases: reading from cache, and then
reading from network (if the cache wasn't available or to be used).
Printing m_bufReceive sounds correct, but note that it's a bytearray so
it's not particularly easy to print out. You have to use e.g. QCString(data,len).
It's certainly simpler to print this from the client side...
Another good place is from the data() call (at line 4067 here). AFAICS this is
the single place where kio_http emits the received data.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kfm-devel mailing list