summaryrefslogtreecommitdiffstats
path: root/examples/network/fortuneclient
diff options
context:
space:
mode:
authorAleksandar Sasha Babic <aleksandar.babic@nokia.com>2009-07-06 12:03:03 (GMT)
committerAleksandar Sasha Babic <aleksandar.babic@nokia.com>2009-07-06 12:06:03 (GMT)
commit252090f78da07b67dcddfe5012e7497b3a135f85 (patch)
tree7a364be07a476bbc103c2bab6051ddd575fbd852 /examples/network/fortuneclient
parentb6909aedbfcafe67c5e2fc1bbda62e0ea672d239 (diff)
downloadQt-252090f78da07b67dcddfe5012e7497b3a135f85.zip
Qt-252090f78da07b67dcddfe5012e7497b3a135f85.tar.gz
Qt-252090f78da07b67dcddfe5012e7497b3a135f85.tar.bz2
Adapting fortuneclient to work on S60 phones.
BTW: somthing shoud be done with layout to make app usable on small screen devices.
Diffstat (limited to 'examples/network/fortuneclient')
-rw-r--r--examples/network/fortuneclient/client.cpp14
-rw-r--r--examples/network/fortuneclient/client.h3
-rw-r--r--examples/network/fortuneclient/fortuneclient.pro7
-rw-r--r--examples/network/fortuneclient/main.cpp6
4 files changed, 29 insertions, 1 deletions
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 <QApplication>
-
#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();
}