mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 12:33:27 +02:00
Report error status in setMapping() callback
This commit is contained in:
parent
23c937e55d
commit
0400e5a1f2
2 changed files with 3 additions and 1 deletions
|
@ -44,7 +44,8 @@ void AssetScriptingInterface::setMapping(QString path, QString hash, QScriptValu
|
||||||
|
|
||||||
QObject::connect(setMappingRequest, &SetMappingRequest::finished, this, [this, callback](SetMappingRequest* request) mutable {
|
QObject::connect(setMappingRequest, &SetMappingRequest::finished, this, [this, callback](SetMappingRequest* request) mutable {
|
||||||
if (callback.isFunction()) {
|
if (callback.isFunction()) {
|
||||||
QScriptValueList args { };
|
QString error = request->getErrorString();
|
||||||
|
QScriptValueList args { error };
|
||||||
callback.call(_engine->currentContext()->thisObject(), args);
|
callback.call(_engine->currentContext()->thisObject(), args);
|
||||||
}
|
}
|
||||||
request->deleteLater();
|
request->deleteLater();
|
||||||
|
|
|
@ -72,6 +72,7 @@ public:
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Called when setMapping is complete
|
* Called when setMapping is complete
|
||||||
* @callback Assets~setMappingCallback
|
* @callback Assets~setMappingCallback
|
||||||
|
* @param {string} error
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void setMapping(QString path, QString hash, QScriptValue callback);
|
Q_INVOKABLE void setMapping(QString path, QString hash, QScriptValue callback);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue