mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 15:13:41 +02:00
Remove optional upload caching
This commit is contained in:
parent
0e0a8301eb
commit
7eadb11404
2 changed files with 6 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue