summaryrefslogtreecommitdiffstats
path: root/examples/network/network-chat
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/network-chat')
-rw-r--r--examples/network/network-chat/chatdialog.cpp4
-rw-r--r--examples/network/network-chat/main.cpp11
-rw-r--r--examples/network/network-chat/network-chat.pro8
-rw-r--r--examples/network/network-chat/peermanager.cpp7
4 files changed, 28 insertions, 2 deletions
diff --git a/examples/network/network-chat/chatdialog.cpp b/examples/network/network-chat/chatdialog.cpp
index 600c601..fa8a3b0 100644
--- a/examples/network/network-chat/chatdialog.cpp
+++ b/examples/network/network-chat/chatdialog.cpp
@@ -54,6 +54,10 @@ ChatDialog::ChatDialog(QWidget *parent)
listWidget->setFocusPolicy(Qt::NoFocus);
connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
+#ifdef Q_OS_SYMBIAN
+ connect(sendButton, SIGNAL(clicked()), this, SLOT(returnPressed()));
+#endif
+ connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
connect(&client, SIGNAL(newMessage(const QString &, const QString &)),
this, SLOT(appendMessage(const QString &, const QString &)));
connect(&client, SIGNAL(newParticipant(const QString &)),
diff --git a/examples/network/network-chat/main.cpp b/examples/network/network-chat/main.cpp
index 1a64af3..e8b4637 100644
--- a/examples/network/network-chat/main.cpp
+++ b/examples/network/network-chat/main.cpp
@@ -42,11 +42,22 @@
#include <QApplication>
#include "chatdialog.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);
ChatDialog dialog;
+#ifdef Q_OS_SYMBIAN
+ // Make application better looking and more usable on small screen
+ dialog.showMaximized();
+#else
dialog.show();
+#endif
return app.exec();
}
diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro
index 5d5efea..99e82ae 100644
--- a/examples/network/network-chat/network-chat.pro
+++ b/examples/network/network-chat/network-chat.pro
@@ -17,3 +17,11 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/network-chat
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS network-chat.pro *.chat
sources.path = $$[QT_INSTALL_EXAMPLES]/network/network-chat
INSTALLS += target sources
+
+symbian {
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ HEADERS += $$QT_SOURCE_TREE/examples/network/ftp/sym_iap_util.h
+ LIBS += -lesock -lconnmon -lcharconv -linsock
+ TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData"
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+}
diff --git a/examples/network/network-chat/peermanager.cpp b/examples/network/network-chat/peermanager.cpp
index 16d9eb1..50224f7 100644
--- a/examples/network/network-chat/peermanager.cpp
+++ b/examples/network/network-chat/peermanager.cpp
@@ -70,7 +70,11 @@ PeerManager::PeerManager(Client *client)
}
if (username.isEmpty())
+#ifndef Q_OS_SYMBIAN
username = "unknown";
+#else
+ username = "QtS60";
+#endif
updateAddresses();
serverPort = 0;
@@ -160,8 +164,7 @@ void PeerManager::updateAddresses()
foreach (QNetworkInterface interface, QNetworkInterface::allInterfaces()) {
foreach (QNetworkAddressEntry entry, interface.addressEntries()) {
QHostAddress broadcastAddress = entry.broadcast();
- if (broadcastAddress != QHostAddress::Null &&
- entry.ip() != QHostAddress::LocalHost) {
+ if (broadcastAddress != QHostAddress::Null && entry.ip() != QHostAddress::LocalHost) {
broadcastAddresses << broadcastAddress;
ipAddresses << entry.ip();
}