From 6d3044db9578d14b11dc7d156e2d81709c3d0ed7 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 12 Apr 2011 17:32:18 +0200 Subject: QNAM: Fix initialization order warnings --- src/network/access/qnetworkreplyhttpimpl.cpp | 50 ++++++++++++++++++---------- src/network/access/qnetworkreplyhttpimpl_p.h | 39 ++++++++++++---------- 2 files changed, 54 insertions(+), 35 deletions(-) (limited to 'src/network') diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index d240fb8ab2..fcfa1bb7ea 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -244,6 +244,7 @@ QNetworkReplyHttpImpl::QNetworkReplyHttpImpl(QNetworkAccessManager* const manage QNetworkReplyHttpImpl::~QNetworkReplyHttpImpl() { + // FIXME? } void QNetworkReplyHttpImpl::close() @@ -361,26 +362,41 @@ bool QNetworkReplyHttpImpl::canReadLine () const QNetworkReplyHttpImplPrivate::QNetworkReplyHttpImplPrivate() // FIXME order etc : QNetworkReplyPrivate() + + , manager(0) + , managerPrivate(0) + , synchronous(false) + + , state(Idle) + , statusCode(0) - , pendingDownloadDataEmissions(new QAtomicInt()) - , pendingDownloadProgressEmissions(new QAtomicInt()) + + , outgoingData(0) + + , bytesUploaded(-1) + + + , cacheLoadDevice(0) , loadingFromCache(false) -#ifndef QT_NO_OPENSSL - , pendingIgnoreAllSslErrors(false) -#endif + + , cacheSaveDevice(0) + , cacheEnabled(false) + + , resumeOffset(0) - , outgoingData(0), - cacheLoadDevice(0), - cacheEnabled(false), cacheSaveDevice(0), - // notificationHandlingPaused(false), - bytesDownloaded(0), lastBytesDownloaded(-1), bytesUploaded(-1), preMigrationDownloaded(-1), - //httpStatusCode(0), - state(Idle) - , downloadBufferReadPosition(0) - , downloadBufferCurrentSize(0) - , downloadBufferMaximumSize(0) - , downloadZerocopyBuffer(0) - , synchronous(false) + , preMigrationDownloaded(-1) + + , bytesDownloaded(0) + , lastBytesDownloaded(-1) + , downloadBufferReadPosition(0) + , downloadBufferCurrentSize(0) + , downloadBufferMaximumSize(0) + , downloadZerocopyBuffer(0) + , pendingDownloadDataEmissions(new QAtomicInt()) + , pendingDownloadProgressEmissions(new QAtomicInt()) + #ifndef QT_NO_OPENSSL + , pendingIgnoreAllSslErrors(false) + #endif { } diff --git a/src/network/access/qnetworkreplyhttpimpl_p.h b/src/network/access/qnetworkreplyhttpimpl_p.h index 2040d4209b..63ad2b9750 100644 --- a/src/network/access/qnetworkreplyhttpimpl_p.h +++ b/src/network/access/qnetworkreplyhttpimpl_p.h @@ -194,25 +194,30 @@ public: void redirectionRequested(const QUrl &target); + // incoming from user QNetworkAccessManager *manager; QNetworkAccessManagerPrivate *managerPrivate; QNetworkRequest request; - QNetworkAccessManager::Operation operation; + QNetworkAccessManager::Operation operation; // FIXME already in replyprivate? + QHttpNetworkRequest httpRequest; // There is also a copy in the HTTP thread + bool synchronous; + State state; + + // from http thread + int statusCode; + QString reasonPhrase; + + // upload QNonContiguousByteDevice* createUploadByteDevice(); QSharedPointer uploadByteDevice; QIODevice *outgoingData; QSharedPointer outgoingDataBuffer; void emitReplyUploadProgress(qint64 bytesSent, qint64 bytesTotal); // dup? - - - bool migrateBackend(); - quint64 resumeOffset; - bool canResume() const; - void setResumeOffset(quint64 offset); qint64 bytesUploaded; - qint64 preMigrationDownloaded; + + // cache void createCache(); void completeCacheSave(); void setCachingEnabled(bool enable); @@ -220,10 +225,11 @@ public: void initCacheSaveDevice(); QAbstractNetworkCache *networkCache() const; QIODevice *cacheLoadDevice; - bool cacheEnabled; // is this for saving? - QIODevice *cacheSaveDevice; bool loadingFromCache; + QIODevice *cacheSaveDevice; + bool cacheEnabled; // is this for saving? + QUrl urlForLastAuthentication; #ifndef QT_NO_NETWORKPROXY @@ -231,11 +237,12 @@ public: QList proxyList; #endif - int statusCode; - QString reasonPhrase; - - State state; + bool migrateBackend(); + bool canResume() const; + void setResumeOffset(quint64 offset); + quint64 resumeOffset; + qint64 preMigrationDownloaded; // Used for normal downloading. For "zero copy" the downloadZerocopyBuffer is used QByteDataBuffer downloadMultiBuffer; @@ -251,14 +258,10 @@ public: QSharedPointer downloadBufferPointer; char* downloadZerocopyBuffer; - - QHttpNetworkRequest httpRequest; // There is also a copy in the HTTP thread - // Will be increased by HTTP thread: QSharedPointer pendingDownloadDataEmissions; QSharedPointer pendingDownloadProgressEmissions; - bool synchronous; #ifndef QT_NO_OPENSSL QSslConfiguration sslConfiguration; -- cgit v1.2.3