Merge pull request #101 from birarda/atp-mappings

fix add to world after upload name change
This commit is contained in:
Clément Brisset 2016-03-10 17:15:13 -08:00
commit 4d2797c25a
2 changed files with 4 additions and 4 deletions

View file

@ -238,7 +238,7 @@ Window {
var directory = path ? path.slice(0, path.lastIndexOf('/') + 1) : "/";
var filename = fileUrl.slice(fileUrl.lastIndexOf('/') + 1);
Assets.uploadFile(fileUrl, directory + filename, function(err) {
Assets.uploadFile(fileUrl, directory + filename, function(err, path) {
if (err) {
console.log("Asset Browser - error uploading: ", fileUrl, " - error ", err);
var box = errorMessage("There was an error uploading:\n" + fileUrl + "\n" + Assets.getErrorString(err));
@ -247,7 +247,7 @@ Window {
console.log("Asset Browser - finished uploading: ", fileUrl);
if (shouldAddToWorld) {
addToWorld("atp:" + directory + filename);
addToWorld("atp:" + path);
}
reload();

View file

@ -54,7 +54,7 @@ void AssetMappingsScriptingInterface::setMapping(QString path, QString hash, QJS
connect(request, &SetMappingRequest::finished, this, [this, callback](SetMappingRequest* request) mutable {
if (callback.isCallable()) {
QJSValueList args { uint8_t(request->getError()) };
QJSValueList args { uint8_t(request->getError()), request->getPath() };
callback.call(args);
}
@ -150,7 +150,7 @@ void AssetMappingsScriptingInterface::getAllMappings(QJSValue callback) {
}
if (callback.isCallable()) {
QJSValueList args { uint8_t(request->getError()) };
QJSValueList args { uint8_t(request->getError()), map };
callback.call(args);
}