summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2018-07-16 13:34:49 +0200
committerJesus Fernandez <Jesus.Fernandez@qt.io>2018-07-16 13:58:23 +0000
commit435d1d53bd61491010dbb2130a27e35cd9798965 (patch)
treea2cb68838e4e2cd5eeea7451557683d96608d081 /src/network
parent9a3359b57b2286286c3a83fcfab79545b3ce114b (diff)
Use nullptr instead of 0
Change-Id: I37e776b84193d705b48d5d75ad620fd41b271d9e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp4
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h11
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp32
3 files changed, 24 insertions, 23 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 76850837d0..96e3f92db1 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -548,7 +548,7 @@ void QNetworkAccessManager::setProxy(const QNetworkProxy &proxy)
Q_D(QNetworkAccessManager);
delete d->proxyFactory;
d->proxy = proxy;
- d->proxyFactory = 0;
+ d->proxyFactory = nullptr;
}
/*!
@@ -1804,7 +1804,7 @@ void QNetworkAccessManagerPrivate::destroyThread()
delete thread;
else
QObject::connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
- thread = 0;
+ thread = nullptr;
}
}
diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h
index 428110e8bc..ffed24a314 100644
--- a/src/network/access/qnetworkaccessmanager_p.h
+++ b/src/network/access/qnetworkaccessmanager_p.h
@@ -77,10 +77,11 @@ class QNetworkAccessManagerPrivate: public QObjectPrivate
{
public:
QNetworkAccessManagerPrivate()
- : networkCache(0), cookieJar(0),
- thread(0),
+ : networkCache(nullptr),
+ cookieJar(nullptr),
+ thread(nullptr),
#ifndef QT_NO_NETWORKPROXY
- proxyFactory(0),
+ proxyFactory(nullptr),
#endif
#ifndef QT_NO_BEARERMANAGEMENT
lastSessionState(QNetworkSession::Invalid),
@@ -130,7 +131,7 @@ public:
bool allowAuthenticationReuse = true);
void cacheCredentials(const QUrl &url, const QAuthenticator *auth);
QNetworkAuthenticationCredential *fetchCachedCredentials(const QUrl &url,
- const QAuthenticator *auth = 0);
+ const QAuthenticator *auth = nullptr);
#ifndef QT_NO_NETWORKPROXY
void proxyAuthenticationRequired(const QUrl &url,
@@ -140,7 +141,7 @@ public:
QNetworkProxy *lastProxyAuthentication);
void cacheProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth);
QNetworkAuthenticationCredential *fetchCachedProxyCredentials(const QNetworkProxy &proxy,
- const QAuthenticator *auth = 0);
+ const QAuthenticator *auth = nullptr);
QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query);
#endif
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 96016453c2..9067dea8e3 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -69,7 +69,7 @@ class QNetworkProxy;
static inline bool isSeparator(char c)
{
static const char separators[] = "()<>@,;:\\\"/[]?={}";
- return isLWS(c) || strchr(separators, c) != 0;
+ return isLWS(c) || strchr(separators, c) != nullptr;
}
// ### merge with nextField in cookiejar.cpp
@@ -438,18 +438,18 @@ void QNetworkReplyHttpImpl::sslConfigurationImplementation(QSslConfiguration &co
QNetworkReplyHttpImplPrivate::QNetworkReplyHttpImplPrivate()
: QNetworkReplyPrivate()
- , manager(0)
- , managerPrivate(0)
+ , manager(nullptr)
+ , managerPrivate(nullptr)
, synchronous(false)
, state(Idle)
, statusCode(0)
, uploadByteDevicePosition(false)
, uploadDeviceChoking(false)
- , outgoingData(0)
+ , outgoingData(nullptr)
, bytesUploaded(-1)
- , cacheLoadDevice(0)
+ , cacheLoadDevice(nullptr)
, loadingFromCache(false)
- , cacheSaveDevice(0)
+ , cacheSaveDevice(nullptr)
, cacheEnabled(false)
, resumeOffset(0)
, preMigrationDownloaded(-1)
@@ -457,7 +457,7 @@ QNetworkReplyHttpImplPrivate::QNetworkReplyHttpImplPrivate()
, bytesBuffered(0)
, downloadBufferReadPosition(0)
, downloadBufferCurrentSize(0)
- , downloadZerocopyBuffer(0)
+ , downloadZerocopyBuffer(nullptr)
, pendingDownloadDataEmissions(QSharedPointer<QAtomicInt>::create())
, pendingDownloadProgressEmissions(QSharedPointer<QAtomicInt>::create())
#ifndef QT_NO_SSL
@@ -618,7 +618,7 @@ void QNetworkReplyHttpImplPrivate::postRequest(const QNetworkRequest &newHttpReq
{
Q_Q(QNetworkReplyHttpImpl);
- QThread *thread = 0;
+ QThread *thread = nullptr;
if (synchronous) {
// A synchronous HTTP request uses its own thread
thread = new QThread();
@@ -1031,7 +1031,7 @@ void QNetworkReplyHttpImplPrivate::initCacheSaveDevice()
managerPrivate->networkCache->metaObject()->className());
managerPrivate->networkCache->remove(url);
- cacheSaveDevice = 0;
+ cacheSaveDevice = nullptr;
cacheEnabled = false;
}
}
@@ -1973,7 +1973,7 @@ void QNetworkReplyHttpImplPrivate::_q_cacheLoadReadyRead()
qint64 actualCount = cacheLoadDevice->read(&c, 1);
if (actualCount < 0) {
cacheLoadDevice->deleteLater();
- cacheLoadDevice = 0;
+ cacheLoadDevice = nullptr;
QMetaObject::invokeMethod(q, "_q_finished", Qt::QueuedConnection);
} else if (actualCount == 1) {
// This is most probably not happening since most QIODevice returned something proper for bytesAvailable()
@@ -1983,7 +1983,7 @@ void QNetworkReplyHttpImplPrivate::_q_cacheLoadReadyRead()
} else if ((!cacheLoadDevice->isSequential() && cacheLoadDevice->atEnd())) {
// This codepath is in case the cache device is a QBuffer, e.g. from QNetworkDiskCache.
cacheLoadDevice->deleteLater();
- cacheLoadDevice = 0;
+ cacheLoadDevice = nullptr;
QMetaObject::invokeMethod(q, "_q_finished", Qt::QueuedConnection);
}
}
@@ -2010,7 +2010,7 @@ void QNetworkReplyHttpImplPrivate::_q_cacheSaveDeviceAboutToClose()
{
// do not keep a dangling pointer to the device around (device
// is closing because e.g. QAbstractNetworkCache::remove() was called).
- cacheSaveDevice = 0;
+ cacheSaveDevice = nullptr;
}
void QNetworkReplyHttpImplPrivate::_q_bufferOutgoingData()
@@ -2162,7 +2162,7 @@ QNonContiguousByteDevice* QNetworkReplyHttpImplPrivate::createUploadByteDevice()
else if (outgoingData) {
uploadByteDevice = QNonContiguousByteDeviceFactory::createShared(outgoingData);
} else {
- return 0;
+ return nullptr;
}
// We want signal emissions only for normal asynchronous uploads
@@ -2335,7 +2335,7 @@ void QNetworkReplyHttpImplPrivate::createCache()
bool QNetworkReplyHttpImplPrivate::isCachingEnabled() const
{
- return (cacheEnabled && managerPrivate->networkCache != 0);
+ return (cacheEnabled && managerPrivate->networkCache != nullptr);
}
void QNetworkReplyHttpImplPrivate::setCachingEnabled(bool enable)
@@ -2359,7 +2359,7 @@ void QNetworkReplyHttpImplPrivate::setCachingEnabled(bool enable)
// ok... but you should make up your mind
qDebug("QNetworkReplyImpl: setCachingEnabled(true) called after setCachingEnabled(false)");
managerPrivate->networkCache->remove(url);
- cacheSaveDevice = 0;
+ cacheSaveDevice = nullptr;
cacheEnabled = false;
}
}
@@ -2376,7 +2376,7 @@ void QNetworkReplyHttpImplPrivate::completeCacheSave()
} else if (cacheEnabled && cacheSaveDevice) {
managerPrivate->networkCache->insert(cacheSaveDevice);
}
- cacheSaveDevice = 0;
+ cacheSaveDevice = nullptr;
cacheEnabled = false;
}