Showing the changes to libraries/script-engine/src/RecordingScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -59,7 +59,7 @@ void RecordingScriptingInterface::playClip(NetworkClipLoaderPointer clipLoader, · 58 unmodified lines | ||
| 59 | 59 | |
| 60 | 60 | if (callback.isFunction()) { |
| 61 | 61 | QScriptValueList args { true, url }; |
| 62 | − callback.call(_scriptEngine->globalObject(), args); | |
| 62 | + callback.call(QScriptValue(), args); | |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| @@ -78,7 +78,7 @@ void RecordingScriptingInterface::loadRecording(const QString& url, QScriptValue · 12 unmodified lines | ||
| 78 | 78 | auto weakClipLoader = clipLoader.toWeakRef(); |
| 79 | 79 | |
| 80 | 80 | // when clip loaded, call the callback with the URL and success boolean |
| 81 | − connect(clipLoader.data(), &recording::NetworkClipLoader::clipLoaded, this, | |
| 81 | + connect(clipLoader.data(), &recording::NetworkClipLoader::clipLoaded, callback.engine(), | |
| 82 | 82 | [this, weakClipLoader, url, callback]() mutable { |
| 83 | 83 | |
| 84 | 84 | if (auto clipLoader = weakClipLoader.toStrongRef()) { |
| @@ -92,12 +92,12 @@ void RecordingScriptingInterface::loadRecording(const QString& url, QScriptValue · 7 unmodified lines | ||
| 92 | 92 | }); |
| 93 | 93 | |
| 94 | 94 | // when clip load fails, call the callback with the URL and failure boolean |
| 95 | − connect(clipLoader.data(), &recording::NetworkClipLoader::failed, this, [this, weakClipLoader, url, callback](QNetworkReply::NetworkError error) mutable { | |
| 95 | + connect(clipLoader.data(), &recording::NetworkClipLoader::failed, callback.engine(), [this, weakClipLoader, url, callback](QNetworkReply::NetworkError error) mutable { | |
| 96 | 96 | qCDebug(scriptengine) << "Failed to load recording from" << url; |
| 97 | 97 | |
| 98 | 98 | if (callback.isFunction()) { |
| 99 | 99 | QScriptValueList args { false, url }; |
| 100 | − callback.call(_scriptEngine->currentContext()->thisObject(), args); | |
| 100 | + callback.call(QScriptValue(), args); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | if (auto clipLoader = weakClipLoader.toStrongRef()) { |