diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-09 17:47:56 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-09 17:47:56 (GMT) |
commit | 9227f8606c85ad9a472628a8a06c312452d69f14 (patch) | |
tree | 004e193bd008fb5bf3c33d128223f425a0e8d614 /src/network/access/qnetworkaccessmanager.cpp | |
parent | e06d011cc08de370ece3b0c324b0a735a2625820 (diff) | |
parent | 0edda17e2edb4da968b026ac6658f740323d6dd5 (diff) | |
download | Qt-9227f8606c85ad9a472628a8a06c312452d69f14.zip Qt-9227f8606c85ad9a472628a8a06c312452d69f14.tar.gz Qt-9227f8606c85ad9a472628a8a06c312452d69f14.tar.bz2 |
Merge branch '4.7-cutoff' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7-cutoff' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (82 commits)
Revert 12b6987031be9faee3886d7623888feb4e1762af
Changed TEST_COMPILER from CC to CXX in configure script.
doc: Fixed several qdoc errors.
Carbon: Native filedialog does not apply filters on app-bundles
Cocoa: Native filedialog does not apply filters on app-bundles
Improve performance of QTimer::singleShot
Add a benchmark comparing single shot timer with invokeMethod
use Qt's private mac functions, reduce code redundancy
Assistant: Fix compile warning for empty header.
Doc: mark QEasingCurve support functions as new in 4.7.
Modify the XML test suite not to use non-characters.
Autotest: Fix failing QTextCodec tests
Doc: mark methods as internal (as they were in previous releases)
Doc: add image for Qt Quick to "What's New" page.
qdoc: Clear a static multimap after each qdocconf file.
qdoc: Added some debug output to track down a crash
Fixed mouse wheel handling in scrollareas.
Added two missing keys for X11
Carbon: usage of menu bars can cause exceptions to be thrown
Mac: compile fix
...
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r-- | src/network/access/qnetworkaccessmanager.cpp | 21 |
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); |