History

resolve conflicts and merge with upstream master

Stephen Birarda committed 11 years ago

Commit c7a5f3c2 parents 9f21b41 0ef26b1158 files · +4391 −1862Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 158 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+11−6
@@ -485,17 +485,17 @@ void ScriptEngine::run() { · 484 unmodified lines
485485
486486 // write audio packet to AudioMixer nodes
487487 NodeList* nodeList = NodeList::getInstance();
488− foreach(const SharedNodePointer& node, nodeList->getNodeHash()) {
488+ nodeList->eachNode([this, &nodeList, &audioPacket, &numPreSequenceNumberBytes](const SharedNodePointer& node){
489489 // only send to nodes of type AudioMixer
490490 if (node->getType() == NodeType::AudioMixer) {
491491 // pack sequence number
492492 quint16 sequence = _outgoingScriptAudioSequenceNumbers[node->getUUID()]++;
493493 memcpy(audioPacket.data() + numPreSequenceNumberBytes, &sequence, sizeof(quint16));
494−
494+
495495 // send audio packet
496496 nodeList->writeDatagram(audioPacket, node);
497497 }
498− }
498+ });
499499 }
500500 }
501501
@@ -602,16 +602,20 @@ void ScriptEngine::stopTimer(QTimer *timer) { · 100 unmodified lines
602602 }
603603
604604 QUrl ScriptEngine::resolvePath(const QString& include) const {
605− // first lets check to see if it's already a full URL
606605 QUrl url(include);
606+ // first lets check to see if it's already a full URL
607607 if (!url.scheme().isEmpty()) {
608608 return url;
609609 }
610610
611611 // we apparently weren't a fully qualified url, so, let's assume we're relative
612612 // to the original URL of our script
613− QUrl parentURL(_fileNameString);
614−
613+ QUrl parentURL;
614+ if (_parentURL.isEmpty()) {
615+ parentURL = QUrl(_fileNameString);
616+ } else {
617+ parentURL = QUrl(_parentURL);
618+ }
615619 // if the parent URL's scheme is empty, then this is probably a local file...
616620 if (parentURL.scheme().isEmpty()) {
617621 parentURL = QUrl::fromLocalFile(_fileNameString);
@@ -644,6 +648,7 @@ void ScriptEngine::include(const QString& includeFile) { · 26 unmodified lines
644648 #else
645649 QString fileName = url.toLocalFile();
646650 #endif
651+
647652 QFile scriptFile(fileName);
648653 if (scriptFile.open(QFile::ReadOnly | QFile::Text)) {
649654 qDebug() << "Including file:" << fileName;