Showing the changes to libraries/script-engine/src/AssetScriptingInterface.cpp (1 of 42 files). Show all
Unified · Split
| @@ -76,7 +76,7 @@ void AssetScriptingInterface::uploadData(QString data, const ScriptValue& callba · 75 unmodified lines | ||
| 76 | 76 | Promise deferred = makePromise(__FUNCTION__); |
| 77 | 77 | Q_ASSERT(engine()); |
| 78 | 78 | auto scriptEngine = engine(); |
| 79 | − deferred->ready([=](QString error, QVariantMap result) { | |
| 79 | + deferred->ready([=, this](QString error, QVariantMap result) { | |
| 80 | 80 | auto url = result.value("url").toString(); |
| 81 | 81 | auto hash = result.value("hash").toString(); |
| 82 | 82 | jsCallback(handler, scriptEngine->newValue(url), scriptEngine->newValue(hash)); |
| @@ -100,7 +100,7 @@ void AssetScriptingInterface::setMapping(QString path, QString hash, const Scrip · 17 unmodified lines | ||
| 100 | 100 | Promise deferred = makePromise(__FUNCTION__); |
| 101 | 101 | Q_ASSERT(engine()); |
| 102 | 102 | auto scriptEngine = engine(); |
| 103 | − deferred->ready([=](QString error, QVariantMap result) { | |
| 103 | + deferred->ready([=, this](QString error, QVariantMap result) { | |
| 104 | 104 | jsCallback(handler, scriptEngine->newValue(error), result); |
| 105 | 105 | }); |
| 106 | 106 | |
| @@ -138,7 +138,7 @@ void AssetScriptingInterface::downloadData(QString urlString, const ScriptValue& · 31 unmodified lines | ||
| 138 | 138 | Promise deferred = makePromise(__FUNCTION__); |
| 139 | 139 | Q_ASSERT(engine()); |
| 140 | 140 | auto scriptEngine = engine(); |
| 141 | − deferred->ready([=](QString error, QVariantMap result) { | |
| 141 | + deferred->ready([=, this](QString error, QVariantMap result) { | |
| 142 | 142 | // FIXME: to remain backwards-compatible the signature here is "callback(data, n/a)" |
| 143 | 143 | jsCallback(handler, scriptEngine->newValue(result.value("data").toString()), { { "errorMessage", error } }); |
| 144 | 144 | }); |
| @@ -202,7 +202,7 @@ void AssetScriptingInterface::getMapping(QString asset, const ScriptValue& callb · 57 unmodified lines | ||
| 202 | 202 | Promise promise = getAssetInfo(path); |
| 203 | 203 | Q_ASSERT(engine()); |
| 204 | 204 | auto scriptEngine = engine(); |
| 205 | − promise->ready([=](QString error, QVariantMap result) { | |
| 205 | + promise->ready([=, this](QString error, QVariantMap result) { | |
| 206 | 206 | jsCallback(handler, scriptEngine->newValue(error), scriptEngine->newValue(result.value("hash").toString())); |
| 207 | 207 | }); |
| 208 | 208 | } |
| @@ -317,7 +317,7 @@ void AssetScriptingInterface::getAsset(const ScriptValue& options, const ScriptV · 108 unmodified lines | ||
| 317 | 317 | |
| 318 | 318 | Promise mapped = makePromise("mapped"); |
| 319 | 319 | mapped->fail(fetched); |
| 320 | − mapped->then([=](QVariantMap result) { | |
| 320 | + mapped->then([=, this](QVariantMap result) { | |
| 321 | 321 | QString hash = result.value("hash").toString(); |
| 322 | 322 | QString url = result.value("url").toString(); |
| 323 | 323 | if (!AssetUtils::isValidHash(hash)) { |
| @@ -397,7 +397,7 @@ void AssetScriptingInterface::decompressData(const ScriptValue& options, const S · 73 unmodified lines | ||
| 397 | 397 | if (responseType == "arraybuffer") { |
| 398 | 398 | decompressed->ready(completed); |
| 399 | 399 | } else { |
| 400 | − decompressed->ready([=](QString error, QVariantMap result) { | |
| 400 | + decompressed->ready([=, this](QString error, QVariantMap result) { | |
| 401 | 401 | Promise converted = convertBytes(result.value("data").toByteArray(), responseType); |
| 402 | 402 | converted->mixin(result); |
| 403 | 403 | converted->ready(completed); |
| @@ -482,7 +482,7 @@ void AssetScriptingInterface::putAsset(const ScriptValue& options, const ScriptV · 78 unmodified lines | ||
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | prepared->fail(completed); |
| 485 | − prepared->then([=](QVariantMap result) { | |
| 485 | + prepared->then([=, this](QVariantMap result) { | |
| 486 | 486 | Promise upload = uploadBytes(result.value("data").toByteArray()); |
| 487 | 487 | upload->mixin(result); |
| 488 | 488 | upload->ready(uploaded); |
| @@ -492,7 +492,7 @@ void AssetScriptingInterface::putAsset(const ScriptValue& options, const ScriptV · 3 unmodified lines | ||
| 492 | 492 | if (path.isEmpty()) { |
| 493 | 493 | uploaded->then(completed); |
| 494 | 494 | } else { |
| 495 | − uploaded->then([=](QVariantMap result) { | |
| 495 | + uploaded->then([=, this](QVariantMap result) { | |
| 496 | 496 | QString hash = result.value("hash").toString(); |
| 497 | 497 | if (!AssetUtils::isValidHash(hash)) { |
| 498 | 498 | completed->reject("path mapping requested, but did not receive valid hash", result); |