From 20cd052040b23427f0d16af39aefa1a208020a9c Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 7 Dec 2009 10:26:56 +1000 Subject: Bring up network on Symbian. --- tools/qmlviewer/main.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ tools/qmlviewer/qmlviewer.pro | 8 ++++++++ 2 files changed, 51 insertions(+) diff --git a/tools/qmlviewer/main.cpp b/tools/qmlviewer/main.cpp index ac0d732..34e5060 100644 --- a/tools/qmlviewer/main.cpp +++ b/tools/qmlviewer/main.cpp @@ -47,6 +47,37 @@ #include #include +#if defined (Q_OS_SYMBIAN) +#define SYMBIAN_NETWORK_INIT +#include +#include +#include +#include +#endif + +#if defined (SYMBIAN_NETWORK_INIT) +#include +#include "sym_iap_util.h" +#endif + +#if defined (Q_OS_SYMBIAN) +void myMessageOutput(QtMsgType type, const char *msg) +{ + static int fd = -1; + if (fd == -1) + fd = ::open("E:\\qmlviewer.log", O_WRONLY | O_CREAT); + + ::write(fd, msg, strlen(msg)); + ::write(fd, "\n", 1); + ::fsync(fd); + + switch (type) { + case QtFatalMsg: + abort(); + } +} +#endif + void usage() { qWarning("Usage: qmlviewer [options] "); @@ -99,6 +130,10 @@ void scriptOptsUsage() int main(int argc, char ** argv) { +#if defined (Q_OS_SYMBIAN) + qInstallMsgHandler(myMessageOutput); +#endif + //### default to using raster graphics backend for now bool gsSpecified = false; for (int i = 0; i < argc; ++i) { @@ -108,8 +143,12 @@ int main(int argc, char ** argv) break; } } + +#if !defined (Q_OS_SYMBIAN) if (!gsSpecified) QApplication::setGraphicsSystem("raster"); +#endif + QApplication app(argc, argv); app.setApplicationName("viewer"); @@ -260,6 +299,10 @@ int main(int argc, char ** argv) usage(); } +#if defined(SYMBIAN_NETWORK_INIT) + qt_SetDefaultIap(); +#endif + viewer.setUseGL(useGL); foreach (QString lib, libraries) viewer.addLibraryPath(lib); diff --git a/tools/qmlviewer/qmlviewer.pro b/tools/qmlviewer/qmlviewer.pro index ce45ed0..e89896d 100644 --- a/tools/qmlviewer/qmlviewer.pro +++ b/tools/qmlviewer/qmlviewer.pro @@ -41,3 +41,11 @@ QT += scripttools \ webkit \ phonon } +symbian { +# TARGET.UID3 = + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h + LIBS += -lesock -lconnmon -linsock + TARGET.CAPABILITY = NetworkServices +} -- cgit v0.12