summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkaccessmanager.cpp
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-03-11 09:15:55 (GMT)
committeraxis <qt-info@nokia.com>2010-03-11 09:42:47 (GMT)
commita375537d32bc33ba1154ec132f99f5a779bce067 (patch)
tree3c23e3b2c44fb52d7d62036fe7dd793e589841e8 /src/network/access/qnetworkaccessmanager.cpp
parent02f6da62a42bd1059eb0da091d1f46efbb919750 (diff)
parent1e9552f826c05bf9884fb2893dedca265ead363b (diff)
downloadQt-a375537d32bc33ba1154ec132f99f5a779bce067.zip
Qt-a375537d32bc33ba1154ec132f99f5a779bce067.tar.gz
Qt-a375537d32bc33ba1154ec132f99f5a779bce067.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public
Conflicts: mkspecs/common/symbian/symbian.conf qmake/generators/makefile.h qmake/project.cpp src/3rdparty/webkit/WebCore/WebCore.pro src/src.pro
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 5876ee2..7bb1399 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -880,11 +880,16 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
return new QDisabledNetworkReply(this, req, op);
}
- if (d->initializeSession && !d->networkSession) {
+ if (!d->networkSession && (d->initializeSession || !d->networkConfiguration.isEmpty())) {
QNetworkConfigurationManager manager;
- d->createSession(manager.defaultConfiguration());
+ if (d->networkConfiguration.isEmpty())
+ d->createSession(manager.defaultConfiguration());
+ else
+ d->createSession(manager.configurationFromIdentifier(d->networkConfiguration));
d->initializeSession = false;
+ } else if (d->networkSession) {
+ d->networkSession->setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), -1);
}
QNetworkRequest request = req;
@@ -943,6 +948,9 @@ void QNetworkAccessManagerPrivate::_q_replyFinished()
QNetworkReply *reply = qobject_cast<QNetworkReply *>(q->sender());
if (reply)
emit q->finished(reply);
+
+ if (networkSession && q->findChildren<QNetworkReply *>().count() == 1)
+ networkSession->setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), 120000);
}
void QNetworkAccessManagerPrivate::_q_replySslErrors(const QList<QSslError> &errors)
@@ -1210,6 +1218,7 @@ void QNetworkAccessManagerPrivate::createSession(const QNetworkConfiguration &co
networkSession = new QNetworkSession(config, q);
QObject::connect(networkSession, SIGNAL(opened()), q, SIGNAL(networkSessionOnline()));
+ QObject::connect(networkSession, SIGNAL(closed()), q, SLOT(_q_networkSessionClosed()));
QObject::connect(networkSession, SIGNAL(newConfigurationActivated()),
q, SLOT(_q_networkSessionNewConfigurationActivated()));
QObject::connect(networkSession,
@@ -1218,6 +1227,14 @@ void QNetworkAccessManagerPrivate::createSession(const QNetworkConfiguration &co
SLOT(_q_networkSessionPreferredConfigurationChanged(QNetworkConfiguration,bool)));
}
+void QNetworkAccessManagerPrivate::_q_networkSessionClosed()
+{
+ networkConfiguration = networkSession->configuration().identifier();
+
+ delete networkSession;
+ networkSession = 0;
+}
+
void QNetworkAccessManagerPrivate::_q_networkSessionNewConfigurationActivated()
{
Q_Q(QNetworkAccessManager);