summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-12-07 00:26:56 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-12-07 00:26:56 (GMT)
commit20cd052040b23427f0d16af39aefa1a208020a9c (patch)
tree4eff5db5aadbcccedeef44a5d0875a918494863e /tools
parent4582fc5c87579fae328d5c18dd7eb7102354511d (diff)
downloadQt-20cd052040b23427f0d16af39aefa1a208020a9c.zip
Qt-20cd052040b23427f0d16af39aefa1a208020a9c.tar.gz
Qt-20cd052040b23427f0d16af39aefa1a208020a9c.tar.bz2
Bring up network on Symbian.
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlviewer/main.cpp43
-rw-r--r--tools/qmlviewer/qmlviewer.pro8
2 files changed, 51 insertions, 0 deletions
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 <QTranslator>
#include <QDebug>
+#if defined (Q_OS_SYMBIAN)
+#define SYMBIAN_NETWORK_INIT
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#endif
+
+#if defined (SYMBIAN_NETWORK_INIT)
+#include <QTextCodec>
+#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] <filename>");
@@ -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
+}