summaryrefslogtreecommitdiffstats
path: root/examples/network
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-30 02:04:14 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-30 02:04:14 (GMT)
commit288f3dae3e66221ab94090c7e3f59b6101f66941 (patch)
tree5b07ac5ff3857c4b2e70d273134fbb45da2e1402 /examples/network
parent91119eaa185934d568d0c83e25129b0028b5a607 (diff)
parent597a842d66dc04181bfd063863216acbb11ce3bc (diff)
downloadQt-288f3dae3e66221ab94090c7e3f59b6101f66941.zip
Qt-288f3dae3e66221ab94090c7e3f59b6101f66941.tar.gz
Qt-288f3dae3e66221ab94090c7e3f59b6101f66941.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Fix crash on Desktop platforms.
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/fortuneserver/server.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp
index b931b96..4dca38c 100644
--- a/examples/network/fortuneserver/server.cpp
+++ b/examples/network/fortuneserver/server.cpp
@@ -107,17 +107,19 @@ Server::Server(QWidget *parent)
void Server::sessionOpened()
{
// Save the used configuration
- QNetworkConfiguration config = networkSession->configuration();
- QString id;
- if (config.type() == QNetworkConfiguration::UserChoice)
- id = networkSession->sessionProperty(QLatin1String("UserChoiceConfiguration")).toString();
- else
- id = config.identifier();
-
- QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
- settings.beginGroup(QLatin1String("QtNetwork"));
- settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
- settings.endGroup();
+ if (networkSession) {
+ QNetworkConfiguration config = networkSession->configuration();
+ QString id;
+ if (config.type() == QNetworkConfiguration::UserChoice)
+ id = networkSession->sessionProperty(QLatin1String("UserChoiceConfiguration")).toString();
+ else
+ id = config.identifier();
+
+ QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ settings.beginGroup(QLatin1String("QtNetwork"));
+ settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
+ settings.endGroup();
+ }
//! [0] //! [1]
tcpServer = new QTcpServer(this);