Review comments

This commit is contained in:
Atlante45 2014-03-13 15:26:02 -07:00
parent 0748682119
commit 423f26f669
3 changed files with 2 additions and 9 deletions

View file

@ -3462,7 +3462,7 @@ void Application::reloadAllScripts() {
void Application::uploadFST() { void Application::uploadFST() {
FstReader reader; FstReader reader;
if(reader.zip()) { if (reader.zip()) {
reader.send(); reader.send();
} }
} }

View file

@ -31,7 +31,6 @@ Q_DECLARE_METATYPE(OAuthAccessToken)
Q_DECLARE_METATYPE(DataServerAccountInfo) Q_DECLARE_METATYPE(DataServerAccountInfo)
Q_DECLARE_METATYPE(QNetworkAccessManager::Operation) Q_DECLARE_METATYPE(QNetworkAccessManager::Operation)
Q_DECLARE_METATYPE(JSONCallbackParameters) Q_DECLARE_METATYPE(JSONCallbackParameters)
Q_DECLARE_METATYPE(QHttpMultiPart)
const QString ACCOUNTS_GROUP = "accounts"; const QString ACCOUNTS_GROUP = "accounts";

View file

@ -38,9 +38,7 @@ FstReader::FstReader() :
} }
FstReader::~FstReader() { FstReader::~FstReader() {
if (_dataMultiPart) { delete _dataMultiPart;
delete _dataMultiPart;
}
} }
bool FstReader::zip() { bool FstReader::zip() {
@ -87,7 +85,6 @@ bool FstReader::zip() {
QHttpPart textPart; QHttpPart textPart;
textPart.setHeader(QNetworkRequest::ContentDispositionHeader, "form-data;" textPart.setHeader(QNetworkRequest::ContentDispositionHeader, "form-data;"
" name=\"model_name\""); " name=\"model_name\"");
//textPart.setRawHeader("name", "\"model_name\"");
textPart.setBody(line[1].toUtf8()); textPart.setBody(line[1].toUtf8());
_dataMultiPart->append(textPart); _dataMultiPart->append(textPart);
} else if (line.first() == FILENAME_FIELD) { } else if (line.first() == FILENAME_FIELD) {
@ -141,7 +138,6 @@ bool FstReader::send() {
AccountManager::getInstance().authenticatedRequest(MODEL_URL, QNetworkAccessManager::PostOperation, JSONCallbackParameters(), QByteArray(), _dataMultiPart); AccountManager::getInstance().authenticatedRequest(MODEL_URL, QNetworkAccessManager::PostOperation, JSONCallbackParameters(), QByteArray(), _dataMultiPart);
_dataMultiPart = NULL;
return true; return true;
} }
@ -213,8 +209,6 @@ bool FstReader::addPart(const QString &path, const QString& name) {
_dataMultiPart->append(part); _dataMultiPart->append(part);
file->setParent(_dataMultiPart); file->setParent(_dataMultiPart);
qDebug() << QFileInfo(*file).fileName().toUtf8();
return true; return true;
} }