mirror of
https://github.com/overte-org/overte.git
synced 2025-06-08 10:30:44 +02:00
Consider a NetworkClipLoader resource with null URL to be failed
This commit is contained in:
parent
ff1d828aaa
commit
7701710aa5
2 changed files with 8 additions and 2 deletions
libraries
|
@ -18,7 +18,13 @@
|
||||||
using namespace recording;
|
using namespace recording;
|
||||||
NetworkClipLoader::NetworkClipLoader(const QUrl& url) :
|
NetworkClipLoader::NetworkClipLoader(const QUrl& url) :
|
||||||
Resource(url),
|
Resource(url),
|
||||||
_clip(std::make_shared<NetworkClip>(url)) {}
|
_clip(std::make_shared<NetworkClip>(url)) {
|
||||||
|
if (url.isEmpty()) {
|
||||||
|
_loaded = false;
|
||||||
|
_startedLoading = false;
|
||||||
|
_failedToLoad = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void NetworkClip::init(const QByteArray& clipData) {
|
void NetworkClip::init(const QByteArray& clipData) {
|
||||||
_clipData = clipData;
|
_clipData = clipData;
|
||||||
|
|
|
@ -93,7 +93,7 @@ void RecordingScriptingInterface::loadRecording(const QString& url, QScriptValue
|
||||||
|
|
||||||
// when clip load fails, call the callback with the URL and failure boolean
|
// when clip load fails, call the callback with the URL and failure boolean
|
||||||
connect(clipLoader.data(), &recording::NetworkClipLoader::failed, callback.engine(), [this, weakClipLoader, url, callback](QNetworkReply::NetworkError error) mutable {
|
connect(clipLoader.data(), &recording::NetworkClipLoader::failed, callback.engine(), [this, weakClipLoader, url, callback](QNetworkReply::NetworkError error) mutable {
|
||||||
qCDebug(scriptengine) << "Failed to load recording from" << url;
|
qCDebug(scriptengine) << "Failed to load recording from\"" << url << '"';
|
||||||
|
|
||||||
if (callback.isFunction()) {
|
if (callback.isFunction()) {
|
||||||
QScriptValueList args { false, url };
|
QScriptValueList args { false, url };
|
||||||
|
|
Loading…
Reference in a new issue