Merge pull request from humbletim/fix-Assets-getMapping

fix Assets.getMapping(path, callback) to return a value
This commit is contained in:
Ryan Huffman 2016-08-01 13:32:08 -07:00 committed by GitHub
commit 604c8f4a36

View file

@ -62,8 +62,10 @@ void AssetMappingsScriptingInterface::getMapping(QString path, QJSValue callback
auto request = assetClient->createGetMappingRequest(path);
connect(request, &GetMappingRequest::finished, this, [this, callback](GetMappingRequest* request) mutable {
auto hash = request->getHash();
if (callback.isCallable()) {
QJSValueList args { request->getErrorString() };
QJSValueList args { request->getErrorString(), hash };
callback.call(args);
}