diff options
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r-- | src/network/access/qnetworkaccessmanager.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 38ab1c6..b8edefa 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -349,8 +349,8 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent) { ensureInitialized(); - d_func()->session = - new QNetworkSession(QNetworkConfigurationManager().defaultConfiguration(), this); + QNetworkConfigurationManager manager; + d_func()->session = new QNetworkSession(manager.defaultConfiguration(), this); } /*! @@ -672,7 +672,7 @@ QNetworkReply *QNetworkAccessManager::deleteResource(const QNetworkRequest &requ /*! \since 4.7 - Sets the network configuration that will be used to \a config. + Sets the network configuration that will be used when creating a network session to \a config. \sa configuration() */ @@ -695,6 +695,22 @@ QNetworkConfiguration QNetworkAccessManager::configuration() const } /*! + \since 4.7 + + Returns the current active network configuration. + + \sa configuration() +*/ +QNetworkConfiguration QNetworkAccessManager::activeConfiguration() const +{ + QNetworkConfigurationManager manager; + + return manager.configurationFromIdentifier( + d_func()->session->sessionProperty(QLatin1String("ActiveConfiguration")).toString()); + +} + +/*! 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 |