mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
Changed FstReader name to ModelUploader
This commit is contained in:
parent
3bb6d9b3b3
commit
9166dea02e
3 changed files with 22 additions and 22 deletions
|
@ -63,7 +63,7 @@
|
|||
#include <UUID.h>
|
||||
#include <OctreeSceneStats.h>
|
||||
#include <LocalVoxelsList.h>
|
||||
#include <FstReader.h>
|
||||
#include <ModelUploader.h>
|
||||
|
||||
#include "Application.h"
|
||||
#include "InterfaceVersion.h"
|
||||
|
@ -3244,9 +3244,9 @@ void Application::toggleRunningScriptsWidget()
|
|||
}
|
||||
|
||||
void Application::uploadFST(bool isHead) {
|
||||
FstReader reader(isHead);
|
||||
if (reader.zip()) {
|
||||
reader.send();
|
||||
ModelUploader* uploader = new ModelUploader(isHead);
|
||||
if (uploader->zip()) {
|
||||
uploader->send();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// FstReader.cpp
|
||||
// ModelUploader.cpp
|
||||
// hifi
|
||||
//
|
||||
// Created by Clément Brisset on 3/4/14.
|
||||
|
@ -18,7 +18,7 @@
|
|||
#include <QMessageBox>
|
||||
|
||||
#include "AccountManager.h"
|
||||
#include "FstReader.h"
|
||||
#include "ModelUploader.h"
|
||||
|
||||
|
||||
static const QString NAME_FIELD = "name";
|
||||
|
@ -38,7 +38,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
FstReader::FstReader(bool isHead) :
|
||||
ModelUploader::ModelUploader(bool isHead) :
|
||||
_zipDir(new TemporaryDir()),
|
||||
_lodCount(-1),
|
||||
_texturesCount(-1),
|
||||
|
@ -51,11 +51,11 @@ FstReader::FstReader(bool isHead) :
|
|||
|
||||
}
|
||||
|
||||
FstReader::~FstReader() {
|
||||
ModelUploader::~ModelUploader() {
|
||||
delete _dataMultiPart;
|
||||
}
|
||||
|
||||
bool FstReader::zip() {
|
||||
bool ModelUploader::zip() {
|
||||
// File Dialog
|
||||
QString filename = QFileDialog::getOpenFileName(NULL,
|
||||
"Select your .fst file ...",
|
||||
|
@ -167,7 +167,7 @@ bool FstReader::zip() {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool FstReader::send() {
|
||||
bool ModelUploader::send() {
|
||||
if (!_readyToSend) {
|
||||
return false;
|
||||
}
|
||||
|
@ -185,13 +185,13 @@ bool FstReader::send() {
|
|||
return true;
|
||||
}
|
||||
|
||||
void FstReader::uploadSuccess(const QJsonObject& jsonResponse) {
|
||||
void ModelUploader::uploadSuccess(const QJsonObject& jsonResponse) {
|
||||
qDebug() << "Model sent with success to the data server.";
|
||||
qDebug() << "It might take a few minute for it to appear in your model browser.";
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void FstReader::uploadFailed(QNetworkReply::NetworkError errorCode, const QString& errorString) {
|
||||
void ModelUploader::uploadFailed(QNetworkReply::NetworkError errorCode, const QString& errorString) {
|
||||
QMessageBox::warning(NULL,
|
||||
QString("ModelUploader::uploadFailed()"),
|
||||
QString("Model could not be sent to the data server."),
|
||||
|
@ -200,7 +200,7 @@ void FstReader::uploadFailed(QNetworkReply::NetworkError errorCode, const QStrin
|
|||
deleteLater();
|
||||
}
|
||||
|
||||
bool FstReader::addTextures(const QFileInfo& texdir) {
|
||||
bool ModelUploader::addTextures(const QFileInfo& texdir) {
|
||||
QStringList filter;
|
||||
filter << "*.png" << "*.tif" << "*.jpg" << "*.jpeg";
|
||||
|
||||
|
@ -229,7 +229,7 @@ bool FstReader::addTextures(const QFileInfo& texdir) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool FstReader::compressFile(const QString &inFileName, const QString &outFileName) {
|
||||
bool ModelUploader::compressFile(const QString &inFileName, const QString &outFileName) {
|
||||
QFile inFile(inFileName);
|
||||
inFile.open(QIODevice::ReadOnly);
|
||||
QByteArray buffer = inFile.readAll();
|
||||
|
@ -253,7 +253,7 @@ bool FstReader::compressFile(const QString &inFileName, const QString &outFileNa
|
|||
}
|
||||
|
||||
|
||||
bool FstReader::addPart(const QString &path, const QString& name) {
|
||||
bool ModelUploader::addPart(const QString &path, const QString& name) {
|
||||
QFile* file = new QFile(path);
|
||||
if (!file->open(QIODevice::ReadOnly)) {
|
||||
QMessageBox::warning(NULL,
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// FstReader.h
|
||||
// ModelUploader.h
|
||||
// hifi
|
||||
//
|
||||
// Created by Clément Brisset on 3/4/14.
|
||||
|
@ -7,19 +7,19 @@
|
|||
//
|
||||
//
|
||||
|
||||
#ifndef __hifi__FstReader__
|
||||
#define __hifi__FstReader__
|
||||
#ifndef __hifi__ModelUploader__
|
||||
#define __hifi__ModelUploader__
|
||||
|
||||
class TemporaryDir;
|
||||
class QHttpMultiPart;
|
||||
class QFileInfo;
|
||||
|
||||
class FstReader : public QObject {
|
||||
class ModelUploader : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FstReader(bool isHead);
|
||||
~FstReader();
|
||||
ModelUploader(bool isHead);
|
||||
~ModelUploader();
|
||||
|
||||
bool zip();
|
||||
bool send();
|
||||
|
@ -44,4 +44,4 @@ private:
|
|||
bool addPart(const QString& path, const QString& name);
|
||||
};
|
||||
|
||||
#endif /* defined(__hifi__FstReader__) */
|
||||
#endif /* defined(__hifi__ModelUploader__) */
|
Loading…
Reference in a new issue