mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-18 06:37:12 +02:00
Code review
This commit is contained in:
parent
3be2319081
commit
e1a1ff3988
3 changed files with 19 additions and 8 deletions
|
@ -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;
|
||||
|
|
|
@ -19,10 +19,7 @@
|
|||
|
||||
class JSONCallbackParameters {
|
||||
public:
|
||||
JSONCallbackParameters() :
|
||||
jsonCallbackReceiver(NULL), jsonCallbackMethod(),
|
||||
errorCallbackReceiver(NULL), errorCallbackMethod(),
|
||||
updateReciever(NULL), updateSlot() {};
|
||||
JSONCallbackParameters();
|
||||
|
||||
bool isEmpty() const { return !jsonCallbackReceiver && !errorCallbackReceiver; }
|
||||
|
||||
|
|
|
@ -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;"
|
||||
|
|
Loading…
Reference in a new issue