Help - Search - Members - Calendar
Full Version: Getting around QNetworkProtocol
OESF Portables Forum > Everything Else > Archived Forums > Distros, Development, and Model Specific Forums > Zaurus - Everything Development > Qt/Qtopia
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, 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.
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:
#include "tturloperator.h"
QString page = TTUrlOperator::getPage("");

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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.