mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 09:23:35 +02:00
Merge branch 'baseball' of https://github.com/huffman/hifi into baseball
This commit is contained in:
commit
917b746a68
1 changed files with 6 additions and 1 deletions
|
@ -902,15 +902,20 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac
|
|||
BatchLoader* loader = new BatchLoader(urls);
|
||||
|
||||
auto evaluateScripts = [=](const QMap<QUrl, QString>& data) {
|
||||
auto parentURL = _parentURL;
|
||||
for (QUrl url : urls) {
|
||||
QString contents = data[url];
|
||||
if (contents.isNull()) {
|
||||
qCDebug(scriptengine) << "Error loading file: " << url << "line:" << __LINE__;
|
||||
} else {
|
||||
// Set the parent url so that path resolution will be relative
|
||||
// to this script's url during its initial evaluation
|
||||
_parentURL = url.toString();
|
||||
QScriptValue result = evaluate(contents, url.toString());
|
||||
}
|
||||
}
|
||||
|
||||
_parentURL = parentURL;
|
||||
|
||||
if (callback.isFunction()) {
|
||||
QScriptValue(callback).call();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue