summaryrefslogtreecommitdiffstats
path: root/examples/network/network-chat/peermanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/network-chat/peermanager.cpp')
-rw-r--r--examples/network/network-chat/peermanager.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/network/network-chat/peermanager.cpp b/examples/network/network-chat/peermanager.cpp
index 7fb91b1..c812505 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,11 @@ 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) {
+ //printf("entry.ip: %s\n", entry.ip().toString().toLatin1().data());
+ //printf("entry.netmask: %s\n", entry.netmask().toString().toLatin1().data());
+ //printf("entry.prefixLength: %i\n", entry.prefixLength());
+ //printf("entry.broadcast %s \n", broadcastAddress.toString().toLatin1().data());
broadcastAddresses << broadcastAddress;
ipAddresses << entry.ip();
}