diff options
author | Aleksandar Sasha Babic <aleksandar.babic@nokia.com> | 2009-07-06 15:30:51 (GMT) |
---|---|---|
committer | Aleksandar Sasha Babic <aleksandar.babic@nokia.com> | 2009-07-06 15:31:57 (GMT) |
commit | 0efaf7ca6cef5e50990bef3a88e64ec1869ad126 (patch) | |
tree | 7b58e19f804c245886c0cec32b02712cf4f2acb4 /examples/network | |
parent | dfa0a27d4ba30bfce9fda8214185a973864b09d6 (diff) | |
download | Qt-0efaf7ca6cef5e50990bef3a88e64ec1869ad126.zip Qt-0efaf7ca6cef5e50990bef3a88e64ec1869ad126.tar.gz Qt-0efaf7ca6cef5e50990bef3a88e64ec1869ad126.tar.bz2 |
Making fortuneserver example working on the S60.
Diffstat (limited to 'examples/network')
-rw-r--r-- | examples/network/fortuneserver/fortuneserver.pro | 8 | ||||
-rw-r--r-- | examples/network/fortuneserver/main.cpp | 11 | ||||
-rw-r--r-- | examples/network/fortuneserver/server.cpp | 9 |
3 files changed, 26 insertions, 2 deletions
diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro index 8cf52ee..ea37b58 100644 --- a/examples/network/fortuneserver/fortuneserver.pro +++ b/examples/network/fortuneserver/fortuneserver.pro @@ -10,3 +10,11 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver INSTALLS += target sources include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian { + HEADERS += $$QT_SOURCE_TREE/examples/network/ftp/sym_iap_util.h + LIBS += -lesock + TARGET.UID3 = 0xA000CF71 + TARGET.CAPABILITY = "All -TCB" + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 +}
\ No newline at end of file diff --git a/examples/network/fortuneserver/main.cpp b/examples/network/fortuneserver/main.cpp index d742fb1..3394c1c 100644 --- a/examples/network/fortuneserver/main.cpp +++ b/examples/network/fortuneserver/main.cpp @@ -46,11 +46,22 @@ #include "server.h" +#ifdef Q_OS_SYMBIAN +#include "sym_iap_util.h" +#endif + int main(int argc, char *argv[]) { +#ifdef Q_OS_SYMBIAN + qt_SetDefaultIap(); +#endif QApplication app(argc, argv); Server server; +#ifdef Q_OS_SYMBIAN + server.showMaximized(); +#else server.show(); +#endif qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); return server.exec(); } diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp index a102ef2..5da43ab 100644 --- a/examples/network/fortuneserver/server.cpp +++ b/examples/network/fortuneserver/server.cpp @@ -63,10 +63,15 @@ Server::Server(QWidget *parent) return; } //! [0] + QList<QHostAddress> ipAddresseList = QNetworkInterface::allAddresses(); + QString ipAddresses; + for (int i = 0; i < ipAddresseList.size(); ++i) { + ipAddresses.append(ipAddresseList.at(i).toString()).append("\n"); + } - statusLabel->setText(tr("The server is running on port %1.\n" + statusLabel->setText(tr("The server is running on \n IP: \n%1 PORT: \n%2\n" "Run the Fortune Client example now.") - .arg(tcpServer->serverPort())); + .arg(ipAddresses).arg(tcpServer->serverPort())); //! [1] //! [2] |