diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-15 03:03:24 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-15 03:03:24 (GMT) |
commit | 21aeae2a2258ab8e5083a0607c3b98579bf6fc58 (patch) | |
tree | e4ae03f88c77e36a1cede9f68fef010cd4575fdd | |
parent | 2d23e45c94b6115db2b1efadfe77841f481545ca (diff) | |
download | Qt-21aeae2a2258ab8e5083a0607c3b98579bf6fc58.zip Qt-21aeae2a2258ab8e5083a0607c3b98579bf6fc58.tar.gz Qt-21aeae2a2258ab8e5083a0607c3b98579bf6fc58.tar.bz2 |
Expand documentation for QNAM::setConfiguration() and friends.
-rw-r--r-- | doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp | 9 | ||||
-rw-r--r-- | src/network/access/qnetworkaccessmanager.cpp | 33 |
2 files changed, 38 insertions, 4 deletions
diff --git a/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp b/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp index 643d0dd..5db6676 100644 --- a/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp +++ b/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp @@ -60,3 +60,12 @@ connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), connect(reply, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>))); //! [1] + +//! [2] +QNetworkConfigurationManager manager; +networkAccessManager->setConfiguration(manager.defaultConfiguration()); +//! [2] + +//! [3] +networkAccessManager->setConfiguration(QNetworkConfiguration()); +//! [3] diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index d9ad085..69b57e5 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -710,9 +710,25 @@ QNetworkReply *QNetworkAccessManager::deleteResource(const QNetworkRequest &requ /*! \since 4.7 - Sets the network configuration that will be used when creating a network session to \a config. + Sets the network configuration that will be used when creating the + \l {QNetworkSession}{network session} to \a config. - \sa configuration() + The network configuration is used to create and open a network session before any request that + requires network access is process. If no network configuration is explicitly set via this + function the network configuration returned by + QNetworkConfigurationManager::defaultConfiguration() will be used. + + To restore the default network configuration set the network configuration to the value + returned from QNetworkConfigurationManager::defaultConfiguration(). + + \snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 2 + + If an invalid network configuration is set, a network session will not be created. In this + case network requests will be processed regardless, but may fail. For example: + + \snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 3 + + \sa configuration(), QNetworkSession */ void QNetworkAccessManager::setConfiguration(const QNetworkConfiguration &config) { @@ -722,9 +738,10 @@ void QNetworkAccessManager::setConfiguration(const QNetworkConfiguration &config /*! \since 4.7 - Returns the network configuration. + Returns the network configuration that will be used to create the + \l {QNetworkSession}{network session} which will be used when processing network requests. - \sa setConfiguration() + \sa setConfiguration(), activeConfiguration() */ QNetworkConfiguration QNetworkAccessManager::configuration() const { @@ -741,6 +758,14 @@ QNetworkConfiguration QNetworkAccessManager::configuration() const Returns the current active network configuration. + If the network configuration returned by configuration() is of type + QNetworkConfiguration::ServiceNetwork this function will return the current active child + network configuration of that configuration. Otherwise returns the same network configuration + as configuration(). + + Use this function to return the actual network configuration currently in use by the network + session. + \sa configuration() */ QNetworkConfiguration QNetworkAccessManager::activeConfiguration() const |