Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1307,7 +1307,7 @@ void ScriptEngine::loadEntityScript(QWeakPointer<ScriptEngine> theEngine, const · 1306 unmodified lines | ||
| 1307 | 1307 | // so that they show up in stacktraces |
| 1308 | 1308 | // |
| 1309 | 1309 | // Extract the url portion of a url that has been encoded with encodeEntityIdIntoEntityUrl(...) |
| 1310 | −QString extractUrlFromEntityUrl(QString url) { | |
| 1310 | +QString extractUrlFromEntityUrl(const QString& url) { | |
| 1311 | 1311 | auto parts = url.split(' ', QString::SkipEmptyParts); |
| 1312 | 1312 | if (parts.length() > 0) { |
| 1313 | 1313 | return parts[0]; |
| @@ -1318,7 +1318,7 @@ QString extractUrlFromEntityUrl(QString url) { · 4 unmodified lines | ||
| 1318 | 1318 | |
| 1319 | 1319 | // Encode an entity id into an entity url |
| 1320 | 1320 | // Example: http://www.example.com/some/path.js [EntityID:{9fdd355f-d226-4887-9484-44432d29520e}] |
| 1321 | −QString encodeEntityIdIntoEntityUrl(QString url, QString entityID) { | |
| 1321 | +QString encodeEntityIdIntoEntityUrl(const QString& url, const QString& entityID) { | |
| 1322 | 1322 | return url + " [EntityID:" + entityID + "]"; |
| 1323 | 1323 | } |
| 1324 | 1324 | |
| @@ -1348,7 +1348,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 23 unmodified lines | ||
| 1348 | 1348 | |
| 1349 | 1349 | auto scriptCache = DependencyManager::get<ScriptCache>(); |
| 1350 | 1350 | bool isFileUrl = isURL && scriptOrURL.startsWith("file://"); |
| 1351 | − auto fileName = isURL ? encodeEntityIdIntoEntityUrl(scriptOrURL, entityID) : "EmbeddedEntityScript"; | |
| 1351 | + auto fileName = isURL ? encodeEntityIdIntoEntityUrl(scriptOrURL, entityID.toString()) : "EmbeddedEntityScript"; | |
| 1352 | 1352 | |
| 1353 | 1353 | QScriptProgram program(contents, fileName); |
| 1354 | 1354 | if (!hasCorrectSyntax(program)) { |