Add autotest interface to get session from QNAM

Change-Id: I7d8ea41299408377042a9f0d0a672e1a6fb57e7d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
This commit is contained in:
Shane Kearns 2012-04-10 13:10:40 +01:00 committed by Qt by Nokia
parent b0c7f34c90
commit 1a6b338e10
2 changed files with 12 additions and 0 deletions

View File

@ -849,6 +849,17 @@ QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccess
}
}
/*!
\internal
Returns the network session currently in use.
This can be changed at any time, ownership remains with the QNetworkAccessManager
*/
const QWeakPointer<const QNetworkSession> QNetworkAccessManagerPrivate::getNetworkSession(const QNetworkAccessManager *q)
{
return q->d_func()->networkSession.toWeakRef();
}
#endif // QT_NO_BEARERMANAGEMENT
/*!

View File

@ -162,6 +162,7 @@ public:
static inline QNetworkAccessCache *getObjectCache(QNetworkAccessBackend *backend)
{ return &backend->manager->objectCache; }
Q_AUTOTEST_EXPORT static void clearCache(QNetworkAccessManager *manager);
Q_AUTOTEST_EXPORT static const QWeakPointer<const QNetworkSession> getNetworkSession(const QNetworkAccessManager *manager);
Q_DECLARE_PUBLIC(QNetworkAccessManager)
};