diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index a1a7a7dd96..2c05e705db 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -834,10 +834,12 @@ QNetworkConfiguration QNetworkAccessManager::configuration() const Q_D(const QNetworkAccessManager); QSharedPointer session(d->getNetworkSession()); - if (session) + if (session) { return session->configuration(); - else - return QNetworkConfiguration(); + } else { + QNetworkConfigurationManager manager; + return manager.defaultConfiguration(); + } } /*! @@ -860,13 +862,12 @@ QNetworkConfiguration QNetworkAccessManager::activeConfiguration() const Q_D(const QNetworkAccessManager); QSharedPointer networkSession(d->getNetworkSession()); + QNetworkConfigurationManager manager; if (networkSession) { - QNetworkConfigurationManager manager; - return manager.configurationFromIdentifier( networkSession->sessionProperty(QLatin1String("ActiveConfiguration")).toString()); } else { - return QNetworkConfiguration(); + return manager.defaultConfiguration(); } }