Commit aa4ab19776a67f882b901b488de8664811df8ae5

Only enable BM by default in QNAM for appropriate platforms.

Bearer Management is of little use on desktop platforms. Change
QNetworkAccessManager to only create a QNetworkSession for the default
configuration on platorms where it is useful (Symbian & Maemo). On other
platforms Bearer Management is still available, but needs to be
explicitly enabled by the application developer by calling
QNetworkAccessManager::setConfiguration().

Use of Bearer Management by default from QNetworkAccessManager is
controlled by the QT_QNAM_BEARERMANAGEMENT_ENABLED define.
  
88QMAKE_INCREMENTAL_STYLE = sublib
99
1010DEFINES += UNICODE QT_KEYPAD_NAVIGATION QT_SOFTKEYS_ENABLED QT_USE_MATH_H_FLOATS
11
12# QNetworkAccessManager to create a network session by default
13DEFINES += QT_QNAM_DEFAULT_NETWORK_SESSION
14
1115QMAKE_COMPILER_DEFINES += SYMBIAN
1216
1317QMAKE_EXT_OBJ = .o
  
3333# Work round SGX 1.4 driver bug (text corrupted), modify glyph cache width:
3434DEFINES += QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024
3535
36# QNetworkAccessManager to create a network session by default
37DEFINES += QT_QNAM_DEFAULT_NETWORK_SESSION
38
3639load(qt_config)
  
880880 return new QDisabledNetworkReply(this, req, op);
881881 }
882882
883#ifdef QT_QNAM_DEFAULT_NETWORK_SESSION
883884 if (!d->networkSession && (d->initializeSession || !d->networkConfiguration.isEmpty())) {
884885 QNetworkConfigurationManager manager;
885886 if (d->networkConfiguration.isEmpty())
886887 d->createSession(manager.defaultConfiguration());
887888 else
888889 d->createSession(manager.configurationFromIdentifier(d->networkConfiguration));
889 } else if (d->networkSession) {
890 d->networkSession->setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), -1);
891890 }
891#endif
892892
893 if (d->networkSession)
894 d->networkSession->setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), -1);
895
893896 QNetworkRequest request = req;
894897 if (!request.header(QNetworkRequest::ContentLengthHeader).isValid() &&
895898 outgoingData && !outgoingData->isSequential()) {
12081208{
12091209 Q_Q(QNetworkAccessManager);
12101210
1211#ifdef QT_QNAM_DEFAULT_NETWORK_SESSION
12111212 initializeSession = false;
1213#endif
12121214
12131215 if (networkSession)
12141216 delete networkSession;
12341234
12351235void QNetworkAccessManagerPrivate::_q_networkSessionClosed()
12361236{
1237 networkConfiguration = networkSession->configuration().identifier();
1237 if (networkSession) {
1238 networkConfiguration = networkSession->configuration().identifier();
12381239
1239 delete networkSession;
1240 networkSession = 0;
1240 networkSession->deleteLater();
1241 networkSession = 0;
1242 }
12411243}
12421244
12431245void QNetworkAccessManagerPrivate::_q_networkSessionNewConfigurationActivated()
12441246{
12451247 Q_Q(QNetworkAccessManager);
12461248
1247 networkSession->accept();
1249 if (networkSession) {
1250 networkSession->accept();
12481251
1249 emit q->networkSessionOnline();
1252 emit q->networkSessionOnline();
1253 }
12501254}
12511255
12521256void QNetworkAccessManagerPrivate::_q_networkSessionPreferredConfigurationChanged(const QNetworkConfiguration &, bool)
12531257{
1254 networkSession->migrate();
1258 if (networkSession)
1259 networkSession->migrate();
12551260}
12561261
12571262QT_END_NAMESPACE
  
7777#endif
7878 networkSession(0),
7979 networkAccessEnabled(true),
80#ifdef QT_QNAM_DEFAULT_NETWORK_SESSION
8081 initializeSession(true),
82#endif
8183 cookieJarCreated(false)
8284 { }
8385 ~QNetworkAccessManagerPrivate();
126126 QNetworkSession *networkSession;
127127 QString networkConfiguration;
128128 bool networkAccessEnabled;
129#ifdef QT_QNAM_DEFAULT_NETWORK_SESSION
129130 bool initializeSession;
131#endif
130132
131133 bool cookieJarCreated;
132134