OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Qt/Qtopia => Topic started by: vanstrien on October 17, 2004, 03:48:03 pm

Title: Getting around QNetworkProtocol
Post by: vanstrien on October 17, 2004, 03:48:03 pm
I've been looking through some of the missing components from QT which were supposedly removed due to size.  It seems like the most important ones relate to transformation functions, dialogs and network protocols.  

The dialogs seems easy enough to deal with: qinputdialog.h just needs a few small changes and it will compile just fine. As for transformations I've just used replacement functions I've found elsewhere or written myself.  

The networking protocols are a bit more tricky.  The lack of qurloperator and qnetworkprotocol.h is a bit of a loss and I don't think they would be easy to port back in.  Besides rewriting what I need or doing the trick that lets you compile libqte.so.3.3.3, have any of the more experienced programmers developed any workarounds?

I've checked out the code to zaurss and I have no idea how Nokubi got it to compile.  As for some of the other applications I've looked at they tend to only do the minimum networking possible.
Title: Getting around QNetworkProtocol
Post by: vanstrien on October 24, 2004, 07:15:42 pm
To answer my own question, and in part because I didn't like the way that QUrlOperator works in the first place, I've put together a quick hack that lets you do a HTTP get as a static method.  Ie:
Code: [Select]
#include "tturloperator.h"
QString page = TTUrlOperator::getPage("http://www.cnn.com");

It will retrieve urls of type 'http' or 'file'.  I didn't have a chance to add FTP.  This just uses raw sockets, by the way.  It doesn't do anything fancy with headers nor have I added in proxy code (although that should be a snap).

There is other code in there to replicate QUrlOperator but I've commented it out to reduce executable size.  If anyone wants anything added let me know and I'll try to put something together.

You can get it here (http://www.vanstrien.net/zaurus/widgets/tturloperator.tgz).