Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 96 files). Show all
Unified · Split
| @@ -156,7 +156,7 @@ ScriptEngine::ScriptEngine(const QUrl& scriptURL, · 155 unmodified lines | |||
| 156 | } else { | 156 | } else { |
| 157 | NetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance(); | 157 | NetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance(); |
| 158 | QNetworkReply* reply = networkAccessManager.get(QNetworkRequest(url)); | 158 | QNetworkReply* reply = networkAccessManager.get(QNetworkRequest(url)); |
| 159 | qDebug() << "Downloading included script at" << url; | 159 | qDebug() << "Downloading script at" << url; |
| 160 | QEventLoop loop; | 160 | QEventLoop loop; |
| 161 | QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit())); | 161 | QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit())); |
| 162 | loop.exec(); | 162 | loop.exec(); |
| @@ -688,12 +688,12 @@ void ScriptEngine::include(const QString& includeFile) { · 525 unmodified lines | |||
| 688 | #endif | 688 | #endif |
| 689 | QFile scriptFile(fileName); | 689 | QFile scriptFile(fileName); |
| 690 | if (scriptFile.open(QFile::ReadOnly | QFile::Text)) { | 690 | if (scriptFile.open(QFile::ReadOnly | QFile::Text)) { |
| 691 | qDebug() << "Loading file:" << fileName; | 691 | qDebug() << "Including file:" << fileName; |
| 692 | QTextStream in(&scriptFile); | 692 | QTextStream in(&scriptFile); |
| 693 | includeContents = in.readAll(); | 693 | includeContents = in.readAll(); |
| 694 | } else { | 694 | } else { |
| 695 | qDebug() << "ERROR Loading file:" << fileName; | 695 | qDebug() << "ERROR Including file:" << fileName; |
| 696 | emit errorMessage("ERROR Loading file:" + fileName); | 696 | emit errorMessage("ERROR Including file:" + fileName); |
| 697 | } | 697 | } |
| 698 | } | 698 | } |
| 699 | 699 | ||
| @@ -706,6 +706,11 @@ void ScriptEngine::include(const QString& includeFile) { · 6 unmodified lines | |||
| 706 | } | 706 | } |
| 707 | } | 707 | } |
| 708 | 708 | ||
| 709 | void ScriptEngine::load(const QString& loadFile) { | ||
| 710 | QUrl url = resolveInclude(loadFile); | ||
| 711 | emit loadScript(url.toString()); | ||
| 712 | } | ||
| 713 | |||
| 709 | void ScriptEngine::nodeKilled(SharedNodePointer node) { | 714 | void ScriptEngine::nodeKilled(SharedNodePointer node) { |
| 710 | _outgoingScriptAudioSequenceNumbers.remove(node->getUUID()); | 715 | _outgoingScriptAudioSequenceNumbers.remove(node->getUUID()); |
| 711 | } | 716 | } |