diff options
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r-- | src/network/access/qnetworkaccessmanager.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index e16aedc..38ab1c6 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -59,6 +59,8 @@ #include "QtCore/qvector.h" #include "QtNetwork/qauthenticator.h" #include "QtNetwork/qsslconfiguration.h" +#include "QtNetwork/qnetworkconfigmanager.h" +#include "QtNetwork/qnetworksession.h" QT_BEGIN_NAMESPACE @@ -346,6 +348,9 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent) : QObject(*new QNetworkAccessManagerPrivate, parent) { ensureInitialized(); + + d_func()->session = + new QNetworkSession(QNetworkConfigurationManager().defaultConfiguration(), this); } /*! @@ -665,6 +670,31 @@ QNetworkReply *QNetworkAccessManager::deleteResource(const QNetworkRequest &requ } /*! + \since 4.7 + + Sets the network configuration that will be used to \a config. + + \sa configuration() +*/ +void QNetworkAccessManager::setConfiguration(const QNetworkConfiguration &config) +{ + delete d_func()->session; + d_func()->session = new QNetworkSession(config, this); +} + +/*! + \since 4.7 + + Returns the network configuration. + + \sa setConfiguration() +*/ +QNetworkConfiguration QNetworkAccessManager::configuration() const +{ + return d_func()->session->configuration(); +} + +/*! Returns a new QNetworkReply object to handle the operation \a op and request \a req. The device \a outgoingData is always 0 for Get and Head requests, but is the value passed to post() and put() in |