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() {
FstReader reader;
if(reader.zip()) {
if (reader.zip()) {
reader.send();
}
}

View file

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

View file

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