diff --git a/libraries/shared/src/AccountManager.cpp b/libraries/shared/src/AccountManager.cpp index fe361ba751..d284640924 100644 --- a/libraries/shared/src/AccountManager.cpp +++ b/libraries/shared/src/AccountManager.cpp @@ -34,6 +34,16 @@ Q_DECLARE_METATYPE(JSONCallbackParameters) const QString ACCOUNTS_GROUP = "accounts"; +JSONCallbackParameters::JSONCallbackParameters() : + jsonCallbackReceiver(NULL), + jsonCallbackMethod(), + errorCallbackReceiver(NULL), + errorCallbackMethod(), + updateReciever(NULL), + updateSlot() +{ +} + AccountManager::AccountManager() : _authURL(), _networkAccessManager(NULL), @@ -178,8 +188,7 @@ void AccountManager::invokedRequest(const QString& path, QNetworkAccessManager:: } // if we ended up firing of a request, hook up to it now - connect(networkReply, SIGNAL(finished()), - SLOT(processReply())); + connect(networkReply, SIGNAL(finished()), SLOT(processReply())); } } } @@ -208,7 +217,7 @@ void AccountManager::passSuccessToCallback(QNetworkReply* requestReply) { // remove the related reply-callback group from the map _pendingCallbackMap.remove(requestReply); - } else { + } else { if (VERBOSE_HTTP_REQUEST_DEBUGGING) { qDebug() << "Received JSON response from data-server that has no matching callback."; qDebug() << jsonResponse; diff --git a/libraries/shared/src/AccountManager.h b/libraries/shared/src/AccountManager.h index 55a40438e0..05a2e6a08a 100644 --- a/libraries/shared/src/AccountManager.h +++ b/libraries/shared/src/AccountManager.h @@ -19,10 +19,7 @@ class JSONCallbackParameters { public: - JSONCallbackParameters() : - jsonCallbackReceiver(NULL), jsonCallbackMethod(), - errorCallbackReceiver(NULL), errorCallbackMethod(), - updateReciever(NULL), updateSlot() {}; + JSONCallbackParameters(); bool isEmpty() const { return !jsonCallbackReceiver && !errorCallbackReceiver; } diff --git a/libraries/shared/src/ModelUploader.cpp b/libraries/shared/src/ModelUploader.cpp index cda57aeab9..4386704559 100644 --- a/libraries/shared/src/ModelUploader.cpp +++ b/libraries/shared/src/ModelUploader.cpp @@ -34,6 +34,8 @@ static const int MAX_SIZE = 10 * 1024 * 1024; // 10 MB static const int TIMEOUT = 1000; static const int MAX_CHECK = 30; +static const int QCOMPRESS_HEADER_POSITION = 0; +static const int QCOMPRESS_HEADER_SIZE = 4; ModelUploader::ModelUploader(bool isHead) : _lodCount(-1), @@ -290,7 +292,10 @@ bool ModelUploader::addPart(const QString &path, const QString& name) { return false; } QByteArray buffer = qCompress(file.readAll()); - buffer.remove(0, 4); + + // Qt's qCompress() default compression level (-1) is the standard zLib compression. + // Here remove Qt's custom header that prevent the data server from uncompressing the files with zLib. + buffer.remove(QCOMPRESS_HEADER_POSITION, QCOMPRESS_HEADER_SIZE); QHttpPart part; part.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data;"