From 6e189eb28161f2d09e0c71ecd590b7ccfd82321c Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Thu, 15 Apr 2010 17:01:12 +1000 Subject: Add missing QT_NO_BEARERMANAGEMENT ifdefs. This add addition ifdefs around code missed by MR 517. --- src/network/access/qnetworkaccessmanager.cpp | 10 ++++------ src/network/access/qnetworkaccessmanager.h | 6 ++++++ src/network/access/qnetworkreplyimpl.cpp | 9 +++++++-- src/network/access/qnetworkreplyimpl_p.h | 6 ++++++ src/plugins/bearer/corewlan/main.cpp | 4 ++++ src/plugins/bearer/corewlan/qcorewlanengine.h | 5 ++++- src/plugins/bearer/corewlan/qcorewlanengine.mm | 8 ++++++-- src/plugins/bearer/icd/main.cpp | 4 ++++ src/plugins/bearer/icd/qicdengine.cpp | 4 ++++ src/plugins/bearer/icd/qnetworksession_impl.cpp | 4 ++++ src/plugins/bearer/icd/qnetworksession_impl.h | 4 ++++ src/plugins/bearer/nativewifi/main.cpp | 4 ++++ src/plugins/bearer/nativewifi/qnativewifiengine.cpp | 4 ++++ src/plugins/bearer/nativewifi/qnativewifiengine.h | 4 ++++ src/plugins/bearer/networkmanager/main.cpp | 2 ++ src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp | 2 ++ src/plugins/bearer/networkmanager/qnetworkmanagerengine.h | 2 ++ src/plugins/bearer/symbian/main.cpp | 4 ++++ src/plugins/bearer/symbian/qnetworksession_impl.cpp | 5 +++++ src/plugins/bearer/symbian/symbianengine.cpp | 4 ++++ 20 files changed, 84 insertions(+), 11 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 &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 diff --git a/src/plugins/bearer/corewlan/main.cpp b/src/plugins/bearer/corewlan/main.cpp index 5be8c0e..628ec61 100644 --- a/src/plugins/bearer/corewlan/main.cpp +++ b/src/plugins/bearer/corewlan/main.cpp @@ -45,6 +45,8 @@ #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE class QCoreWlanEnginePlugin : public QBearerEnginePlugin @@ -82,3 +84,5 @@ Q_EXPORT_STATIC_PLUGIN(QCoreWlanEnginePlugin) Q_EXPORT_PLUGIN2(qcorewlanbearer, QCoreWlanEnginePlugin) QT_END_NAMESPACE + +#endif // QT_NO_BEARERMANAGEMENT diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h index 11f5d96..5c69299 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.h +++ b/src/plugins/bearer/corewlan/qcorewlanengine.h @@ -48,6 +48,8 @@ #include #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE class QNetworkConfigurationPrivate; @@ -107,5 +109,6 @@ protected: QT_END_NAMESPACE -#endif +#endif // QT_NO_BEARERMANAGEMENT +#endif diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index e418432..268126a 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -67,6 +67,10 @@ #include #include "private/qcore_mac_p.h" +#ifndef QT_NO_BEARERMANAGEMENT + +QT_BEGIN_NAMESPACE + @interface QNSListener : NSObject { NSNotificationCenter *center; @@ -126,8 +130,6 @@ QNSListener *listener = 0; -QT_BEGIN_NAMESPACE - void networkChangeCallback(SCDynamicStoreRef/* store*/, CFArrayRef changedKeys, void *info) { for ( long i = 0; i < CFArrayGetCount(changedKeys); i++) { @@ -778,3 +780,5 @@ void QCoreWlanEngine::getUserConfigurations() } QT_END_NAMESPACE + +#endif // QT_NO_BEARERMANAGEMENT diff --git a/src/plugins/bearer/icd/main.cpp b/src/plugins/bearer/icd/main.cpp index ad1a918..491112b 100644 --- a/src/plugins/bearer/icd/main.cpp +++ b/src/plugins/bearer/icd/main.cpp @@ -45,6 +45,8 @@ #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE class QIcdEnginePlugin : public QBearerEnginePlugin @@ -82,3 +84,5 @@ Q_EXPORT_STATIC_PLUGIN(QIcdEnginePlugin) Q_EXPORT_PLUGIN2(qicdbearer, QIcdEnginePlugin) QT_END_NAMESPACE + +#endif diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp index a6cf0c2..fc9b469 100644 --- a/src/plugins/bearer/icd/qicdengine.cpp +++ b/src/plugins/bearer/icd/qicdengine.cpp @@ -47,6 +47,8 @@ #include #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE IcdNetworkConfigurationPrivate::IcdNetworkConfigurationPrivate() @@ -988,3 +990,5 @@ QNetworkSessionPrivate *QIcdEngine::createSessionBackend() #include "qicdengine.moc" QT_END_NAMESPACE + +#endif // QT_NO_BEARERMANAGEMENT diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index 2928a31..a6acce0 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -52,6 +52,8 @@ #include #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE QDBusArgument &operator<<(QDBusArgument &argument, @@ -1044,3 +1046,5 @@ void QNetworkSessionPrivateImpl::clearProxyInformation() } QT_END_NAMESPACE + +#endif // QT_NO_BEARERMANAGEMENT diff --git a/src/plugins/bearer/icd/qnetworksession_impl.h b/src/plugins/bearer/icd/qnetworksession_impl.h index d15f401..c43b1f0 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.h +++ b/src/plugins/bearer/icd/qnetworksession_impl.h @@ -66,6 +66,8 @@ #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE class QIcdEngine; @@ -210,5 +212,7 @@ Q_DECLARE_METATYPE(ICd2DetailsList); QT_END_NAMESPACE +#endif // QT_NO_BEARERMANAGEMENT + #endif //QNETWORKSESSIONPRIVATE_H diff --git a/src/plugins/bearer/nativewifi/main.cpp b/src/plugins/bearer/nativewifi/main.cpp index d77462e..98789aa 100644 --- a/src/plugins/bearer/nativewifi/main.cpp +++ b/src/plugins/bearer/nativewifi/main.cpp @@ -50,6 +50,8 @@ #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE static void resolveLibrary() @@ -137,3 +139,5 @@ Q_EXPORT_STATIC_PLUGIN(QNativeWifiEnginePlugin) Q_EXPORT_PLUGIN2(qnativewifibearer, QNativeWifiEnginePlugin) QT_END_NAMESPACE + +#endif // QT_NO_BEARERMANAGEMENT diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp index 6c74159..e796df3 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp @@ -49,6 +49,8 @@ #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE WlanOpenHandleProto local_WlanOpenHandle = 0; @@ -558,3 +560,5 @@ bool QNativeWifiEngine::requiresPolling() const } QT_END_NAMESPACE + +#endif // QT_NO_BEARERMANAGEMENT diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.h b/src/plugins/bearer/nativewifi/qnativewifiengine.h index 2005b2b..77764e4 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.h +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.h @@ -57,6 +57,8 @@ #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE class QNetworkConfigurationPrivate; @@ -101,4 +103,6 @@ private: QT_END_NAMESPACE +#endif // QT_NO_BEARERMANAGEMENT + #endif diff --git a/src/plugins/bearer/networkmanager/main.cpp b/src/plugins/bearer/networkmanager/main.cpp index 88068fc..9ab2c39 100644 --- a/src/plugins/bearer/networkmanager/main.cpp +++ b/src/plugins/bearer/networkmanager/main.cpp @@ -45,6 +45,7 @@ #include +#ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_DBUS QT_BEGIN_NAMESPACE @@ -91,3 +92,4 @@ Q_EXPORT_PLUGIN2(qnmbearer, QNetworkManagerEnginePlugin) QT_END_NAMESPACE #endif // QT_NO_DBUS +#endif // QT_NO_BEARERMANAGEMENT diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp index 06533a1..13b2252 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp @@ -56,6 +56,7 @@ #include #include +#ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_DBUS QT_BEGIN_NAMESPACE @@ -918,3 +919,4 @@ QNetworkConfigurationPrivatePointer QNetworkManagerEngine::defaultConfiguration( QT_END_NAMESPACE #endif // QT_NO_DBUS +#endif // QT_NO_BEARERMANAGEMENT diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h index 964726e..7f8badb 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h @@ -60,6 +60,7 @@ #include #include +#ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_DBUS QT_BEGIN_NAMESPACE @@ -140,6 +141,7 @@ private: QT_END_NAMESPACE #endif // QT_NO_DBUS +#endif // QT_NO_BEARERMANAGEMENT #endif diff --git a/src/plugins/bearer/symbian/main.cpp b/src/plugins/bearer/symbian/main.cpp index 0321451..c4f539b 100644 --- a/src/plugins/bearer/symbian/main.cpp +++ b/src/plugins/bearer/symbian/main.cpp @@ -45,6 +45,8 @@ #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE class QSymbianEnginePlugin : public QBearerEnginePlugin @@ -82,3 +84,5 @@ Q_EXPORT_STATIC_PLUGIN(QSymbianEnginePlugin) Q_EXPORT_PLUGIN2(qsymbianbearer, QSymbianEnginePlugin) QT_END_NAMESPACE + +#endif // QT_NO_BEARERMANAGEMENT diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index 36fbc51..1b9c8cc 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -48,6 +48,8 @@ #include #include +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine) @@ -1367,3 +1369,6 @@ void ConnectionProgressNotifier::RunL() } QT_END_NAMESPACE + +#endif //QT_NO_BEARERMANAGEMENT + diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp index 440f463..c629d02 100644 --- a/src/plugins/bearer/symbian/symbianengine.cpp +++ b/src/plugins/bearer/symbian/symbianengine.cpp @@ -69,6 +69,8 @@ #include #endif +#ifndef QT_NO_BEARERMANAGEMENT + QT_BEGIN_NAMESPACE static const int KValueThatWillBeAddedToSNAPId = 1000; @@ -1130,3 +1132,5 @@ void AccessPointsAvailabilityScanner::RunL() } QT_END_NAMESPACE + +#endif // QT_NO_BEARERMANAGEMENT -- cgit v0.12