Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 84 files). Show all
Unified · Split
| @@ -551,7 +551,7 @@ void ScriptEngine::init() { · 550 unmodified lines | |||
| 551 | void ScriptEngine::registerValue(const QString& valueName, QScriptValue value) { | 551 | void ScriptEngine::registerValue(const QString& valueName, QScriptValue value) { |
| 552 | if (QThread::currentThread() != thread()) { | 552 | if (QThread::currentThread() != thread()) { |
| 553 | #ifdef THREAD_DEBUGGING | 553 | #ifdef THREAD_DEBUGGING |
| 554 | qDebug() << "*** WARNING *** ScriptEngine::registerValue() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; | 554 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerValue() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; |
| 555 | #endif | 555 | #endif |
| 556 | QMetaObject::invokeMethod(this, "registerValue", | 556 | QMetaObject::invokeMethod(this, "registerValue", |
| 557 | Q_ARG(const QString&, valueName), | 557 | Q_ARG(const QString&, valueName), |
| @@ -581,7 +581,7 @@ void ScriptEngine::registerValue(const QString& valueName, QScriptValue value) { · 23 unmodified lines | |||
| 581 | void ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { | 581 | void ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { |
| 582 | if (QThread::currentThread() != thread()) { | 582 | if (QThread::currentThread() != thread()) { |
| 583 | #ifdef THREAD_DEBUGGING | 583 | #ifdef THREAD_DEBUGGING |
| 584 | qDebug() << "*** WARNING *** ScriptEngine::registerGlobalObject() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; | 584 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerGlobalObject() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; |
| 585 | #endif | 585 | #endif |
| 586 | QMetaObject::invokeMethod(this, "registerGlobalObject", | 586 | QMetaObject::invokeMethod(this, "registerGlobalObject", |
| 587 | Q_ARG(const QString&, name), | 587 | Q_ARG(const QString&, name), |
| @@ -589,7 +589,7 @@ void ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { · 1 unmodified line | |||
| 589 | return; | 589 | return; |
| 590 | } | 590 | } |
| 591 | #ifdef THREAD_DEBUGGING | 591 | #ifdef THREAD_DEBUGGING |
| 592 | qDebug() << "ScriptEngine::registerGlobalObject() called on thread [" << QThread::currentThread() << "] name:" << name; | 592 | qCDebug(scriptengine) << "ScriptEngine::registerGlobalObject() called on thread [" << QThread::currentThread() << "] name:" << name; |
| 593 | #endif | 593 | #endif |
| 594 | 594 | ||
| 595 | if (!globalObject().property(name).isValid()) { | 595 | if (!globalObject().property(name).isValid()) { |
| @@ -605,7 +605,7 @@ void ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { · 9 unmodified lines | |||
| 605 | void ScriptEngine::registerFunction(const QString& name, QScriptEngine::FunctionSignature functionSignature, int numArguments) { | 605 | void ScriptEngine::registerFunction(const QString& name, QScriptEngine::FunctionSignature functionSignature, int numArguments) { |
| 606 | if (QThread::currentThread() != thread()) { | 606 | if (QThread::currentThread() != thread()) { |
| 607 | #ifdef THREAD_DEBUGGING | 607 | #ifdef THREAD_DEBUGGING |
| 608 | qDebug() << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; | 608 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; |
| 609 | #endif | 609 | #endif |
| 610 | QMetaObject::invokeMethod(this, "registerFunction", | 610 | QMetaObject::invokeMethod(this, "registerFunction", |
| 611 | Q_ARG(const QString&, name), | 611 | Q_ARG(const QString&, name), |
| @@ -614,7 +614,7 @@ void ScriptEngine::registerFunction(const QString& name, QScriptEngine::Function · 2 unmodified lines | |||
| 614 | return; | 614 | return; |
| 615 | } | 615 | } |
| 616 | #ifdef THREAD_DEBUGGING | 616 | #ifdef THREAD_DEBUGGING |
| 617 | qDebug() << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] name:" << name; | 617 | qCDebug(scriptengine) << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] name:" << name; |
| 618 | #endif | 618 | #endif |
| 619 | 619 | ||
| 620 | QScriptValue scriptFun = newFunction(functionSignature, numArguments); | 620 | QScriptValue scriptFun = newFunction(functionSignature, numArguments); |
| @@ -624,7 +624,7 @@ void ScriptEngine::registerFunction(const QString& name, QScriptEngine::Function · 3 unmodified lines | |||
| 624 | void ScriptEngine::registerFunction(const QString& parent, const QString& name, QScriptEngine::FunctionSignature functionSignature, int numArguments) { | 624 | void ScriptEngine::registerFunction(const QString& parent, const QString& name, QScriptEngine::FunctionSignature functionSignature, int numArguments) { |
| 625 | if (QThread::currentThread() != thread()) { | 625 | if (QThread::currentThread() != thread()) { |
| 626 | #ifdef THREAD_DEBUGGING | 626 | #ifdef THREAD_DEBUGGING |
| 627 | qDebug() << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] parent:" << parent << "name:" << name; | 627 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] parent:" << parent << "name:" << name; |
| 628 | #endif | 628 | #endif |
| 629 | QMetaObject::invokeMethod(this, "registerFunction", | 629 | QMetaObject::invokeMethod(this, "registerFunction", |
| 630 | Q_ARG(const QString&, name), | 630 | Q_ARG(const QString&, name), |
| @@ -633,7 +633,7 @@ void ScriptEngine::registerFunction(const QString& parent, const QString& name, · 2 unmodified lines | |||
| 633 | return; | 633 | return; |
| 634 | } | 634 | } |
| 635 | #ifdef THREAD_DEBUGGING | 635 | #ifdef THREAD_DEBUGGING |
| 636 | qDebug() << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] parent:" << parent << "name:" << name; | 636 | qCDebug(scriptengine) << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] parent:" << parent << "name:" << name; |
| 637 | #endif | 637 | #endif |
| 638 | 638 | ||
| 639 | QScriptValue object = globalObject().property(parent); | 639 | QScriptValue object = globalObject().property(parent); |
| @@ -647,7 +647,7 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func · 7 unmodified lines | |||
| 647 | QScriptEngine::FunctionSignature setter, const QString& parent) { | 647 | QScriptEngine::FunctionSignature setter, const QString& parent) { |
| 648 | if (QThread::currentThread() != thread()) { | 648 | if (QThread::currentThread() != thread()) { |
| 649 | #ifdef THREAD_DEBUGGING | 649 | #ifdef THREAD_DEBUGGING |
| 650 | qDebug() << "*** WARNING *** ScriptEngine::registerGetterSetter() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " | 650 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerGetterSetter() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " |
| 651 | " name:" << name << "parent:" << parent; | 651 | " name:" << name << "parent:" << parent; |
| 652 | #endif | 652 | #endif |
| 653 | QMetaObject::invokeMethod(this, "registerGetterSetter", | 653 | QMetaObject::invokeMethod(this, "registerGetterSetter", |
| @@ -658,7 +658,7 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func · 4 unmodified lines | |||
| 658 | return; | 658 | return; |
| 659 | } | 659 | } |
| 660 | #ifdef THREAD_DEBUGGING | 660 | #ifdef THREAD_DEBUGGING |
| 661 | qDebug() << "ScriptEngine::registerGetterSetter() called on thread [" << QThread::currentThread() << "] name:" << name << "parent:" << parent; | 661 | qCDebug(scriptengine) << "ScriptEngine::registerGetterSetter() called on thread [" << QThread::currentThread() << "] name:" << name << "parent:" << parent; |
| 662 | #endif | 662 | #endif |
| 663 | 663 | ||
| 664 | QScriptValue setterFunction = newFunction(setter, 1); | 664 | QScriptValue setterFunction = newFunction(setter, 1); |
| @@ -680,7 +680,7 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func · 15 unmodified lines | |||
| 680 | void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QString& eventName, QScriptValue handler) { | 680 | void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QString& eventName, QScriptValue handler) { |
| 681 | if (QThread::currentThread() != thread()) { | 681 | if (QThread::currentThread() != thread()) { |
| 682 | #ifdef THREAD_DEBUGGING | 682 | #ifdef THREAD_DEBUGGING |
| 683 | qDebug() << "*** WARNING *** ScriptEngine::removeEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " | 683 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::removeEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " |
| 684 | "entityID:" << entityID << " eventName:" << eventName; | 684 | "entityID:" << entityID << " eventName:" << eventName; |
| 685 | #endif | 685 | #endif |
| 686 | QMetaObject::invokeMethod(this, "removeEventHandler", | 686 | QMetaObject::invokeMethod(this, "removeEventHandler", |
| @@ -690,7 +690,7 @@ void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QStrin · 3 unmodified lines | |||
| 690 | return; | 690 | return; |
| 691 | } | 691 | } |
| 692 | #ifdef THREAD_DEBUGGING | 692 | #ifdef THREAD_DEBUGGING |
| 693 | qDebug() << "ScriptEngine::removeEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName; | 693 | qCDebug(scriptengine) << "ScriptEngine::removeEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName; |
| 694 | #endif | 694 | #endif |
| 695 | 695 | ||
| 696 | if (!_registeredHandlers.contains(entityID)) { | 696 | if (!_registeredHandlers.contains(entityID)) { |
| @@ -710,7 +710,7 @@ void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QStrin · 13 unmodified lines | |||
| 710 | void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& eventName, QScriptValue handler) { | 710 | void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& eventName, QScriptValue handler) { |
| 711 | if (QThread::currentThread() != thread()) { | 711 | if (QThread::currentThread() != thread()) { |
| 712 | #ifdef THREAD_DEBUGGING | 712 | #ifdef THREAD_DEBUGGING |
| 713 | qDebug() << "*** WARNING *** ScriptEngine::addEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " | 713 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::addEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " |
| 714 | "entityID:" << entityID << " eventName:" << eventName; | 714 | "entityID:" << entityID << " eventName:" << eventName; |
| 715 | #endif | 715 | #endif |
| 716 | 716 | ||
| @@ -721,7 +721,7 @@ void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& · 4 unmodified lines | |||
| 721 | return; | 721 | return; |
| 722 | } | 722 | } |
| 723 | #ifdef THREAD_DEBUGGING | 723 | #ifdef THREAD_DEBUGGING |
| 724 | qDebug() << "ScriptEngine::addEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName; | 724 | qCDebug(scriptengine) << "ScriptEngine::addEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName; |
| 725 | #endif | 725 | #endif |
| 726 | 726 | ||
| 727 | if (_registeredHandlers.count() == 0) { // First time any per-entity handler has been added in this script... | 727 | if (_registeredHandlers.count() == 0) { // First time any per-entity handler has been added in this script... |
| @@ -796,7 +796,7 @@ QScriptValue ScriptEngine::evaluate(const QString& sourceCode, const QString& fi · 68 unmodified lines | |||
| 796 | if (QThread::currentThread() != thread()) { | 796 | if (QThread::currentThread() != thread()) { |
| 797 | QScriptValue result; | 797 | QScriptValue result; |
| 798 | #ifdef THREAD_DEBUGGING | 798 | #ifdef THREAD_DEBUGGING |
| 799 | qDebug() << "*** WARNING *** ScriptEngine::evaluate() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " | 799 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::evaluate() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " |
| 800 | "sourceCode:" << sourceCode << " fileName:" << fileName << "lineNumber:" << lineNumber; | 800 | "sourceCode:" << sourceCode << " fileName:" << fileName << "lineNumber:" << lineNumber; |
| 801 | #endif | 801 | #endif |
| 802 | QMetaObject::invokeMethod(this, "evaluate", Qt::BlockingQueuedConnection, | 802 | QMetaObject::invokeMethod(this, "evaluate", Qt::BlockingQueuedConnection, |
| @@ -1010,7 +1010,7 @@ void ScriptEngine::stop(bool marshal) { · 207 unmodified lines | |||
| 1010 | void ScriptEngine::callAnimationStateHandler(QScriptValue callback, AnimVariantMap parameters, QStringList names, bool useNames, AnimVariantResultHandler resultHandler) { | 1010 | void ScriptEngine::callAnimationStateHandler(QScriptValue callback, AnimVariantMap parameters, QStringList names, bool useNames, AnimVariantResultHandler resultHandler) { |
| 1011 | if (QThread::currentThread() != thread()) { | 1011 | if (QThread::currentThread() != thread()) { |
| 1012 | #ifdef THREAD_DEBUGGING | 1012 | #ifdef THREAD_DEBUGGING |
| 1013 | qDebug() << "*** WARNING *** ScriptEngine::callAnimationStateHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; | 1013 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callAnimationStateHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; |
| 1014 | #endif | 1014 | #endif |
| 1015 | QMetaObject::invokeMethod(this, "callAnimationStateHandler", | 1015 | QMetaObject::invokeMethod(this, "callAnimationStateHandler", |
| 1016 | Q_ARG(QScriptValue, callback), | 1016 | Q_ARG(QScriptValue, callback), |
| @@ -1182,7 +1182,7 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac · 165 unmodified lines | |||
| 1182 | thisURL = expandScriptUrl(QUrl::fromLocalFile(expandScriptPath(file))); | 1182 | thisURL = expandScriptUrl(QUrl::fromLocalFile(expandScriptPath(file))); |
| 1183 | QUrl defaultScriptsLoc = defaultScriptsLocation(); | 1183 | QUrl defaultScriptsLoc = defaultScriptsLocation(); |
| 1184 | if (!defaultScriptsLoc.isParentOf(thisURL)) { | 1184 | if (!defaultScriptsLoc.isParentOf(thisURL)) { |
| 1185 | qDebug() << "ScriptEngine::include -- skipping" << file << "-- outside of standard libraries"; | 1185 | qCDebug(scriptengine) << "ScriptEngine::include -- skipping" << file << "-- outside of standard libraries"; |
| 1186 | continue; | 1186 | continue; |
| 1187 | } | 1187 | } |
| 1188 | isStandardLibrary = true; | 1188 | isStandardLibrary = true; |
| @@ -1297,7 +1297,7 @@ void ScriptEngine::load(const QString& loadFile) { · 108 unmodified lines | |||
| 1297 | // Look up the handler associated with eventName and entityID. If found, evalute the argGenerator thunk and call the handler with those args | 1297 | // Look up the handler associated with eventName and entityID. If found, evalute the argGenerator thunk and call the handler with those args |
| 1298 | void ScriptEngine::forwardHandlerCall(const EntityItemID& entityID, const QString& eventName, QScriptValueList eventHandlerArgs) { | 1298 | void ScriptEngine::forwardHandlerCall(const EntityItemID& entityID, const QString& eventName, QScriptValueList eventHandlerArgs) { |
| 1299 | if (QThread::currentThread() != thread()) { | 1299 | if (QThread::currentThread() != thread()) { |
| 1300 | qDebug() << "*** ERROR *** ScriptEngine::forwardHandlerCall() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; | 1300 | qCDebug(scriptengine) << "*** ERROR *** ScriptEngine::forwardHandlerCall() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; |
| 1301 | assert(false); | 1301 | assert(false); |
| 1302 | return ; | 1302 | return ; |
| 1303 | } | 1303 | } |
| @@ -1331,7 +1331,7 @@ void ScriptEngine::loadEntityScript(QWeakPointer<ScriptEngine> theEngine, const · 27 unmodified lines | |||
| 1331 | QSharedPointer<ScriptEngine> strongEngine = theEngine.toStrongRef(); | 1331 | QSharedPointer<ScriptEngine> strongEngine = theEngine.toStrongRef(); |
| 1332 | if (strongEngine) { | 1332 | if (strongEngine) { |
| 1333 | #ifdef THREAD_DEBUGGING | 1333 | #ifdef THREAD_DEBUGGING |
| 1334 | qDebug() << "ScriptEngine::entityScriptContentAvailable() IN LAMBDA contentAvailable on thread [" | 1334 | qCDebug(scriptengine) << "ScriptEngine::entityScriptContentAvailable() IN LAMBDA contentAvailable on thread [" |
| 1335 | << QThread::currentThread() << "] expected thread [" << strongEngine->thread() << "]"; | 1335 | << QThread::currentThread() << "] expected thread [" << strongEngine->thread() << "]"; |
| 1336 | #endif | 1336 | #endif |
| 1337 | strongEngine->entityScriptContentAvailable(entityID, scriptOrURL, contents, isURL, success); | 1337 | strongEngine->entityScriptContentAvailable(entityID, scriptOrURL, contents, isURL, success); |
| @@ -1344,7 +1344,7 @@ void ScriptEngine::loadEntityScript(QWeakPointer<ScriptEngine> theEngine, const · 6 unmodified lines | |||
| 1344 | void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, const QString& scriptOrURL, const QString& contents, bool isURL, bool success) { | 1344 | void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, const QString& scriptOrURL, const QString& contents, bool isURL, bool success) { |
| 1345 | if (QThread::currentThread() != thread()) { | 1345 | if (QThread::currentThread() != thread()) { |
| 1346 | #ifdef THREAD_DEBUGGING | 1346 | #ifdef THREAD_DEBUGGING |
| 1347 | qDebug() << "*** WARNING *** ScriptEngine::entityScriptContentAvailable() called on wrong thread [" | 1347 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::entityScriptContentAvailable() called on wrong thread [" |
| 1348 | << QThread::currentThread() << "], invoking on correct thread [" << thread() | 1348 | << QThread::currentThread() << "], invoking on correct thread [" << thread() |
| 1349 | << "] " "entityID:" << entityID << "scriptOrURL:" << scriptOrURL << "contents:" | 1349 | << "] " "entityID:" << entityID << "scriptOrURL:" << scriptOrURL << "contents:" |
| 1350 | << contents << "isURL:" << isURL << "success:" << success; | 1350 | << contents << "isURL:" << isURL << "success:" << success; |
| @@ -1360,7 +1360,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 9 unmodified lines | |||
| 1360 | } | 1360 | } |
| 1361 | 1361 | ||
| 1362 | #ifdef THREAD_DEBUGGING | 1362 | #ifdef THREAD_DEBUGGING |
| 1363 | qDebug() << "ScriptEngine::entityScriptContentAvailable() thread [" << QThread::currentThread() << "] expected thread [" << thread() << "]"; | 1363 | qCDebug(scriptengine) << "ScriptEngine::entityScriptContentAvailable() thread [" << QThread::currentThread() << "] expected thread [" << thread() << "]"; |
| 1364 | #endif | 1364 | #endif |
| 1365 | 1365 | ||
| 1366 | auto scriptCache = DependencyManager::get<ScriptCache>(); | 1366 | auto scriptCache = DependencyManager::get<ScriptCache>(); |
| @@ -1448,7 +1448,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 81 unmodified lines | |||
| 1448 | void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { | 1448 | void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { |
| 1449 | if (QThread::currentThread() != thread()) { | 1449 | if (QThread::currentThread() != thread()) { |
| 1450 | #ifdef THREAD_DEBUGGING | 1450 | #ifdef THREAD_DEBUGGING |
| 1451 | qDebug() << "*** WARNING *** ScriptEngine::unloadEntityScript() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " | 1451 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadEntityScript() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " |
| 1452 | "entityID:" << entityID; | 1452 | "entityID:" << entityID; |
| 1453 | #endif | 1453 | #endif |
| 1454 | 1454 | ||
| @@ -1457,7 +1457,7 @@ void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { · 2 unmodified lines | |||
| 1457 | return; | 1457 | return; |
| 1458 | } | 1458 | } |
| 1459 | #ifdef THREAD_DEBUGGING | 1459 | #ifdef THREAD_DEBUGGING |
| 1460 | qDebug() << "ScriptEngine::unloadEntityScript() called on correct thread [" << thread() << "] " | 1460 | qCDebug(scriptengine) << "ScriptEngine::unloadEntityScript() called on correct thread [" << thread() << "] " |
| 1461 | "entityID:" << entityID; | 1461 | "entityID:" << entityID; |
| 1462 | #endif | 1462 | #endif |
| 1463 | 1463 | ||
| @@ -1471,14 +1471,14 @@ void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { · 7 unmodified lines | |||
| 1471 | void ScriptEngine::unloadAllEntityScripts() { | 1471 | void ScriptEngine::unloadAllEntityScripts() { |
| 1472 | if (QThread::currentThread() != thread()) { | 1472 | if (QThread::currentThread() != thread()) { |
| 1473 | #ifdef THREAD_DEBUGGING | 1473 | #ifdef THREAD_DEBUGGING |
| 1474 | qDebug() << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; | 1474 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; |
| 1475 | #endif | 1475 | #endif |
| 1476 | 1476 | ||
| 1477 | QMetaObject::invokeMethod(this, "unloadAllEntityScripts"); | 1477 | QMetaObject::invokeMethod(this, "unloadAllEntityScripts"); |
| 1478 | return; | 1478 | return; |
| 1479 | } | 1479 | } |
| 1480 | #ifdef THREAD_DEBUGGING | 1480 | #ifdef THREAD_DEBUGGING |
| 1481 | qDebug() << "ScriptEngine::unloadAllEntityScripts() called on correct thread [" << thread() << "]"; | 1481 | qCDebug(scriptengine) << "ScriptEngine::unloadAllEntityScripts() called on correct thread [" << thread() << "]"; |
| 1482 | #endif | 1482 | #endif |
| 1483 | foreach(const EntityItemID& entityID, _entityScripts.keys()) { | 1483 | foreach(const EntityItemID& entityID, _entityScripts.keys()) { |
| 1484 | callEntityScriptMethod(entityID, "unload"); | 1484 | callEntityScriptMethod(entityID, "unload"); |
| @@ -1486,13 +1486,13 @@ void ScriptEngine::unloadAllEntityScripts() { · 1 unmodified line | |||
| 1486 | _entityScripts.clear(); | 1486 | _entityScripts.clear(); |
| 1487 | 1487 | ||
| 1488 | #ifdef DEBUG_ENGINE_STATE | 1488 | #ifdef DEBUG_ENGINE_STATE |
| 1489 | qDebug() << "---- CURRENT STATE OF ENGINE: --------------------------"; | 1489 | qCDebug(scriptengine) << "---- CURRENT STATE OF ENGINE: --------------------------"; |
| 1490 | QScriptValueIterator it(globalObject()); | 1490 | QScriptValueIterator it(globalObject()); |
| 1491 | while (it.hasNext()) { | 1491 | while (it.hasNext()) { |
| 1492 | it.next(); | 1492 | it.next(); |
| 1493 | qDebug() << it.name() << ":" << it.value().toString(); | 1493 | qCDebug(scriptengine) << it.name() << ":" << it.value().toString(); |
| 1494 | } | 1494 | } |
| 1495 | qDebug() << "--------------------------------------------------------"; | 1495 | qCDebug(scriptengine) << "--------------------------------------------------------"; |
| 1496 | #endif // DEBUG_ENGINE_STATE | 1496 | #endif // DEBUG_ENGINE_STATE |
| 1497 | } | 1497 | } |
| 1498 | 1498 | ||
| @@ -1563,7 +1563,7 @@ void ScriptEngine::callWithEnvironment(const EntityItemID& entityID, const QUrl& · 64 unmodified lines | |||
| 1563 | void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const QStringList& params) { | 1563 | void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const QStringList& params) { |
| 1564 | if (QThread::currentThread() != thread()) { | 1564 | if (QThread::currentThread() != thread()) { |
| 1565 | #ifdef THREAD_DEBUGGING | 1565 | #ifdef THREAD_DEBUGGING |
| 1566 | qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " | 1566 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " |
| 1567 | "entityID:" << entityID << "methodName:" << methodName; | 1567 | "entityID:" << entityID << "methodName:" << methodName; |
| 1568 | #endif | 1568 | #endif |
| 1569 | 1569 | ||
| @@ -1574,7 +1574,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 4 unmodified lines | |||
| 1574 | return; | 1574 | return; |
| 1575 | } | 1575 | } |
| 1576 | #ifdef THREAD_DEBUGGING | 1576 | #ifdef THREAD_DEBUGGING |
| 1577 | qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " | 1577 | qCDebug(scriptengine) << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " |
| 1578 | "entityID:" << entityID << "methodName:" << methodName; | 1578 | "entityID:" << entityID << "methodName:" << methodName; |
| 1579 | #endif | 1579 | #endif |
| 1580 | 1580 | ||
| @@ -1595,7 +1595,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 14 unmodified lines | |||
| 1595 | void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const PointerEvent& event) { | 1595 | void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const PointerEvent& event) { |
| 1596 | if (QThread::currentThread() != thread()) { | 1596 | if (QThread::currentThread() != thread()) { |
| 1597 | #ifdef THREAD_DEBUGGING | 1597 | #ifdef THREAD_DEBUGGING |
| 1598 | qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " | 1598 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " |
| 1599 | "entityID:" << entityID << "methodName:" << methodName << "event: mouseEvent"; | 1599 | "entityID:" << entityID << "methodName:" << methodName << "event: mouseEvent"; |
| 1600 | #endif | 1600 | #endif |
| 1601 | 1601 | ||
| @@ -1606,7 +1606,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 4 unmodified lines | |||
| 1606 | return; | 1606 | return; |
| 1607 | } | 1607 | } |
| 1608 | #ifdef THREAD_DEBUGGING | 1608 | #ifdef THREAD_DEBUGGING |
| 1609 | qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " | 1609 | qCDebug(scriptengine) << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " |
| 1610 | "entityID:" << entityID << "methodName:" << methodName << "event: pointerEvent"; | 1610 | "entityID:" << entityID << "methodName:" << methodName << "event: pointerEvent"; |
| 1611 | #endif | 1611 | #endif |
| 1612 | 1612 | ||
| @@ -1627,7 +1627,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 14 unmodified lines | |||
| 1627 | void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const EntityItemID& otherID, const Collision& collision) { | 1627 | void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const EntityItemID& otherID, const Collision& collision) { |
| 1628 | if (QThread::currentThread() != thread()) { | 1628 | if (QThread::currentThread() != thread()) { |
| 1629 | #ifdef THREAD_DEBUGGING | 1629 | #ifdef THREAD_DEBUGGING |
| 1630 | qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " | 1630 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " |
| 1631 | "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision"; | 1631 | "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision"; |
| 1632 | #endif | 1632 | #endif |
| 1633 | 1633 | ||
| @@ -1639,7 +1639,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 5 unmodified lines | |||
| 1639 | return; | 1639 | return; |
| 1640 | } | 1640 | } |
| 1641 | #ifdef THREAD_DEBUGGING | 1641 | #ifdef THREAD_DEBUGGING |
| 1642 | qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " | 1642 | qCDebug(scriptengine) << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " |
| 1643 | "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision"; | 1643 | "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision"; |
| 1644 | #endif | 1644 | #endif |
| 1645 | 1645 | ||