diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-04-15 07:01:12 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-04-15 07:01:12 (GMT) |
commit | 6e189eb28161f2d09e0c71ecd590b7ccfd82321c (patch) | |
tree | 635377ded015a9252a54b1940051e636d83ab675 /src/network | |
parent | 3925bab16a88822fcef749cb6ba7c542688c2fae (diff) | |
download | Qt-6e189eb28161f2d09e0c71ecd590b7ccfd82321c.zip Qt-6e189eb28161f2d09e0c71ecd590b7ccfd82321c.tar.gz Qt-6e189eb28161f2d09e0c71ecd590b7ccfd82321c.tar.bz2 |
Add missing QT_NO_BEARERMANAGEMENT ifdefs.
This add addition ifdefs around code missed by MR 517.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qnetworkaccessmanager.cpp | 10 | ||||
-rw-r--r-- | src/network/access/qnetworkaccessmanager.h | 6 | ||||
-rw-r--r-- | src/network/access/qnetworkreplyimpl.cpp | 9 | ||||
-rw-r--r-- | src/network/access/qnetworkreplyimpl_p.h | 6 |
4 files changed, 23 insertions, 8 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index d26956f..feb9d99 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -917,18 +917,14 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera return new QFileNetworkReply(this, req, op); } +#ifndef QT_NO_BEARERMANAGEMENT // Return a disabled network reply if network access is disabled. // Except if the scheme is empty or file://. - if ( -#ifndef QT_NO_BEARERMANAGEMENT - !d->networkAccessible && -#endif - !(req.url().scheme() == QLatin1String("file") || + if (!d->networkAccessible && !(req.url().scheme() == QLatin1String("file") || req.url().scheme().isEmpty())) { return new QDisabledNetworkReply(this, req, op); } -#ifndef QT_NO_BEARERMANAGEMENT if (!d->networkSession && (d->initializeSession || !d->networkConfiguration.isEmpty())) { QNetworkConfigurationManager manager; if (!d->networkConfiguration.isEmpty()) { @@ -961,10 +957,12 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera // first step: create the reply QUrl url = request.url(); QNetworkReplyImpl *reply = new QNetworkReplyImpl(this); +#ifndef QT_NO_BEARERMANAGEMENT if (req.url().scheme() != QLatin1String("file") && !req.url().scheme().isEmpty()) { connect(this, SIGNAL(networkSessionConnected()), reply, SLOT(_q_networkSessionConnected())); } +#endif QNetworkReplyImplPrivate *priv = reply->d_func(); priv->manager = this; diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h index 771bc70..a0ffb07 100644 --- a/src/network/access/qnetworkaccessmanager.h +++ b/src/network/access/qnetworkaccessmanager.h @@ -72,7 +72,9 @@ class Q_NETWORK_EXPORT QNetworkAccessManager: public QObject { Q_OBJECT +#ifndef QT_NO_BEARERMANAGEMENT Q_PROPERTY(NetworkAccessibility networkAccessible READ networkAccessible WRITE setNetworkAccessible NOTIFY networkAccessibleChanged) +#endif public: enum Operation { @@ -86,11 +88,13 @@ public: UnknownOperation = 0 }; +#ifndef QT_NO_BEARERMANAGEMENT enum NetworkAccessibility { UnknownAccessibility = -1, NotAccessible = 0, Accessible = 1 }; +#endif explicit QNetworkAccessManager(QObject *parent = 0); ~QNetworkAccessManager(); @@ -136,9 +140,11 @@ Q_SIGNALS: void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors); #endif +#ifndef QT_NO_BEARERMANAGEMENT void networkSessionConnected(); void networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility accessible); +#endif protected: virtual QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index fa7420f..c3dc168 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -67,8 +67,6 @@ inline QNetworkReplyImplPrivate::QNetworkReplyImplPrivate() void QNetworkReplyImplPrivate::_q_startOperation() { - Q_Q(QNetworkReplyImpl); - // ensure this function is only being called once if (state == Working) { qDebug("QNetworkReplyImpl::_q_startOperation was called more than once"); @@ -96,6 +94,8 @@ void QNetworkReplyImplPrivate::_q_startOperation() QNetworkSession *session = manager->d_func()->networkSession; if (session) { + Q_Q(QNetworkReplyImpl); + QObject::connect(session, SIGNAL(error(QNetworkSession::SessionError)), q, SLOT(_q_networkSessionFailed())); @@ -104,6 +104,7 @@ void QNetworkReplyImplPrivate::_q_startOperation() } else { qWarning("Backend is waiting for QNetworkSession to connect, but there is none!"); } + return; } #endif @@ -233,6 +234,7 @@ void QNetworkReplyImplPrivate::_q_bufferOutgoingData() } } +#ifndef QT_NO_BEARERMANAGEMENT void QNetworkReplyImplPrivate::_q_networkSessionConnected() { Q_Q(QNetworkReplyImpl); @@ -273,6 +275,7 @@ void QNetworkReplyImplPrivate::_q_networkSessionFailed() finished(); } } +#endif void QNetworkReplyImplPrivate::setup(QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *data) @@ -892,6 +895,7 @@ bool QNetworkReplyImplPrivate::migrateBackend() return true; } +#ifndef QT_NO_BEARERMANAGEMENT QDisabledNetworkReply::QDisabledNetworkReply(QObject *parent, const QNetworkRequest &req, QNetworkAccessManager::Operation op) @@ -915,6 +919,7 @@ QDisabledNetworkReply::QDisabledNetworkReply(QObject *parent, QDisabledNetworkReply::~QDisabledNetworkReply() { } +#endif QT_END_NAMESPACE diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h index fcb3397..bc7e408 100644 --- a/src/network/access/qnetworkreplyimpl_p.h +++ b/src/network/access/qnetworkreplyimpl_p.h @@ -99,8 +99,10 @@ public: Q_PRIVATE_SLOT(d_func(), void _q_copyReadChannelFinished()) Q_PRIVATE_SLOT(d_func(), void _q_bufferOutgoingData()) Q_PRIVATE_SLOT(d_func(), void _q_bufferOutgoingDataFinished()) +#ifndef QT_NO_BEARERMANAGEMENT Q_PRIVATE_SLOT(d_func(), void _q_networkSessionConnected()) Q_PRIVATE_SLOT(d_func(), void _q_networkSessionFailed()) +#endif }; class QNetworkReplyImplPrivate: public QNetworkReplyPrivate @@ -133,8 +135,10 @@ public: void _q_copyReadChannelFinished(); void _q_bufferOutgoingData(); void _q_bufferOutgoingDataFinished(); +#ifndef QT_NO_BEARERMANAGEMENT void _q_networkSessionConnected(); void _q_networkSessionFailed(); +#endif void setup(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData); @@ -196,6 +200,7 @@ public: Q_DECLARE_PUBLIC(QNetworkReplyImpl) }; +#ifndef QT_NO_BEARERMANAGEMENT class QDisabledNetworkReply : public QNetworkReply { Q_OBJECT @@ -209,6 +214,7 @@ public: protected: qint64 readData(char *, qint64) { return -1; } }; +#endif QT_END_NAMESPACE |