From 252090f78da07b67dcddfe5012e7497b3a135f85 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Mon, 6 Jul 2009 14:03:03 +0200 Subject: Adapting fortuneclient to work on S60 phones. BTW: somthing shoud be done with layout to make app usable on small screen devices. --- examples/network/fortuneclient/client.cpp | 14 ++++++++++++++ examples/network/fortuneclient/client.h | 3 +++ examples/network/fortuneclient/fortuneclient.pro | 7 +++++++ examples/network/fortuneclient/main.cpp | 6 +++++- 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/examples/network/fortuneclient/client.cpp b/examples/network/fortuneclient/client.cpp index f3947e2..9828d86 100644 --- a/examples/network/fortuneclient/client.cpp +++ b/examples/network/fortuneclient/client.cpp @@ -44,6 +44,10 @@ #include "client.h" +#ifdef Q_OS_SYMBIAN +#include "sym_iap_util.h" +#endif + //! [0] Client::Client(QWidget *parent) : QDialog(parent) @@ -102,6 +106,10 @@ Client::Client(QWidget *parent) setWindowTitle(tr("Fortune Client")); portLineEdit->setFocus(); + +#ifdef Q_OS_SYMBIAN + isDefaultIapSet = false; +#endif //! [5] } //! [5] @@ -110,6 +118,12 @@ Client::Client(QWidget *parent) void Client::requestNewFortune() { getFortuneButton->setEnabled(false); +#ifdef Q_OS_SYMBIAN + if(!isDefaultIapSet) { + qt_SetDefaultIap(); + isDefaultIapSet = true; + } +#endif blockSize = 0; tcpSocket->abort(); //! [7] diff --git a/examples/network/fortuneclient/client.h b/examples/network/fortuneclient/client.h index c8b8b26..714d871 100644 --- a/examples/network/fortuneclient/client.h +++ b/examples/network/fortuneclient/client.h @@ -80,6 +80,9 @@ private: QTcpSocket *tcpSocket; QString currentFortune; quint16 blockSize; +#ifdef Q_OS_SYMBIAN + bool isDefaultIapSet; +#endif }; //! [0] diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro index bb125e8..4765208 100644 --- a/examples/network/fortuneclient/fortuneclient.pro +++ b/examples/network/fortuneclient/fortuneclient.pro @@ -10,3 +10,10 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneclient 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.CAPABILITY = "NetworkServices ReadUserData WriteUserData" + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 +} diff --git a/examples/network/fortuneclient/main.cpp b/examples/network/fortuneclient/main.cpp index 0cc7378..4db555c 100644 --- a/examples/network/fortuneclient/main.cpp +++ b/examples/network/fortuneclient/main.cpp @@ -40,13 +40,17 @@ ****************************************************************************/ #include - #include "client.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); Client client; +#ifdef Q_OS_SYMBIAN + // Make application better looking and more usable on small screen + client.showMaximized(); +#else client.show(); +#endif return client.exec(); } -- cgit v0.12