Remove optional upload caching

This commit is contained in:
Atlante45 2015-10-12 15:09:17 -07:00
parent 0e0a8301eb
commit 7eadb11404
2 changed files with 6 additions and 7 deletions

View file

@ -23,9 +23,9 @@ AssetUpload::AssetUpload(QObject* object, const QString& filename) :
}
void AssetUpload::start(bool cacheOnSuccess) {
void AssetUpload::start() {
if (QThread::currentThread() != thread()) {
QMetaObject::invokeMethod(this, "start", Q_ARG(bool, cacheOnSuccess));
QMetaObject::invokeMethod(this, "start");
return;
}
@ -44,9 +44,8 @@ void AssetUpload::start(bool cacheOnSuccess) {
qCDebug(asset_client) << "Attempting to upload" << _filename << "to asset-server.";
assetClient->uploadAsset(_data, _extension,
[this, cacheOnSuccess](bool responseReceived, AssetServerError error,
const QString& hash){
assetClient->uploadAsset(_data, _extension, [this](bool responseReceived, AssetServerError error,
const QString& hash){
if (!responseReceived) {
_error = NetworkError;
} else {
@ -66,7 +65,7 @@ void AssetUpload::start(bool cacheOnSuccess) {
}
}
if (cacheOnSuccess && _error == NoError && hash == hashData(_data).toHex()) {
if (_error == NoError && hash == hashData(_data).toHex()) {
saveToCache(getUrl(hash, _extension), _data);
}

View file

@ -37,7 +37,7 @@ public:
AssetUpload(QObject* parent, const QString& filename);
Q_INVOKABLE void start(bool cacheOnSuccess = true);
Q_INVOKABLE void start();
const QString& getFilename() const { return _filename; }
const QString& getExtension() const { return _extension; }