summaryrefslogtreecommitdiffstats
path: root/examples/network/fortuneserver/server.cpp
diff options
context:
space:
mode:
authorAleksandar Sasha Babic <aleksandar.babic@nokia.com>2009-07-06 15:30:51 (GMT)
committerAleksandar Sasha Babic <aleksandar.babic@nokia.com>2009-07-06 15:31:57 (GMT)
commit0efaf7ca6cef5e50990bef3a88e64ec1869ad126 (patch)
tree7b58e19f804c245886c0cec32b02712cf4f2acb4 /examples/network/fortuneserver/server.cpp
parentdfa0a27d4ba30bfce9fda8214185a973864b09d6 (diff)
downloadQt-0efaf7ca6cef5e50990bef3a88e64ec1869ad126.zip
Qt-0efaf7ca6cef5e50990bef3a88e64ec1869ad126.tar.gz
Qt-0efaf7ca6cef5e50990bef3a88e64ec1869ad126.tar.bz2
Making fortuneserver example working on the S60.
Diffstat (limited to 'examples/network/fortuneserver/server.cpp')
-rw-r--r--examples/network/fortuneserver/server.cpp9
1 files changed, 7 insertions, 2 deletions
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]