mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01: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
|
@ -18,7 +18,13 @@
|
|||
using namespace recording;
|
||||
NetworkClipLoader::NetworkClipLoader(const QUrl& 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) {
|
||||
_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
|
||||
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()) {
|
||||
QScriptValueList args { false, url };
|
||||
|
|
Loading…
Reference in a new issue