From 625032f748bea7402abe80f70a6b32be6265dc9a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 10 Mar 2016 17:10:49 -0800 Subject: [PATCH] fix for add to world after upload name change --- interface/resources/qml/AssetServer.qml | 4 ++-- interface/src/scripting/AssetMappingsScriptingInterface.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/resources/qml/AssetServer.qml b/interface/resources/qml/AssetServer.qml index a4421ac371..a3fe6cacb8 100644 --- a/interface/resources/qml/AssetServer.qml +++ b/interface/resources/qml/AssetServer.qml @@ -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(); diff --git a/interface/src/scripting/AssetMappingsScriptingInterface.cpp b/interface/src/scripting/AssetMappingsScriptingInterface.cpp index 603fd4dadd..32b697459c 100644 --- a/interface/src/scripting/AssetMappingsScriptingInterface.cpp +++ b/interface/src/scripting/AssetMappingsScriptingInterface.cpp @@ -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); }